Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当用户要求提示时扣除硬币_Javascript_Jquery_Ajax - Fatal编程技术网

Javascript 当用户要求提示时扣除硬币

Javascript 当用户要求提示时扣除硬币,javascript,jquery,ajax,Javascript,Jquery,Ajax,我想创建一个提示,提示用户是否需要答案提示。 如果用户需要提示,它将显示提示并从用户处扣除100个硬币。我试了很多次,但还是不起作用 <a href="#hint" class="btn btn-info" id="hint" data-toggle="collapse" onclick="Confirmation()">Hint</a> function Confirmation() { var retVal = confirm("Ar

我想创建一个提示,提示用户是否需要答案提示。 如果用户需要提示,它将显示提示并从用户处扣除100个硬币。我试了很多次,但还是不起作用

 <a href="#hint" class="btn btn-info" id="hint" data-toggle="collapse" 
       onclick="Confirmation()">Hint</a>



 function Confirmation() {
    var retVal = confirm("Are you sure you want a hint");
    if (retVal == true) {
        <div id="hint" class="collapse">
          <span style=" border: 1px solid #d6d6d6;">Answer: A </span>
       </div>
      **//Not sure on how to deduct 100 coins**

        return true;
    }
    else {
        document.write("User does not want to continue!");
        return false;
    }
}
onclick=确认

函数getConfirmation


Confirmation和getConfirmation是两个不同的标签

调用Confirmation时函数名为getConfirmation