首页 > 解决方案 > 用户要求提示时扣币

问题描述

我想创建一个提示,它会提示用户是否需要提示答案。如果用户想要一个提示,它会显示一个提示并从用户那里扣除 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;
    }
}

标签: javascriptjqueryajax

解决方案


您正在调用 Confirmation() 而您的函数名为 getConfirmation()


推荐阅读