Javascript 当用户要求提示时扣除硬币
我想创建一个提示,提示用户是否需要答案提示。 如果用户需要提示,它将显示提示并从用户处扣除100个硬币。我试了很多次,但还是不起作用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
<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