input text 改变 点击 数字

时间:2013.08.16 发布人:yeguandf

input text 改变 点击 数字

已解决问题

谷歌yeguandf用户在2013.08.16提交了关于“异世邪君input text 改变 点击 数字”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-08-27T05:21:54。<inputname="**M"type="hidden"value="20">
<divstyle="color:#FF00FF"id="S_1">3</div>
<divstyle="color:#FF00FF"id="S_2">4</div>
<inputtype="button"value="减一"onclick="**M(1)">
<inputtype="button"value="减二"onclick="**M(2)">

<scriptlanguage="j**ascript">
Function**M(n)
{

……需要补充代码……

document.getElementById("S_"+n).innerText=M;
}
</script>


要求:
1、“点击』次<inputname="**M">里的值就减去“n”;
2、“M”的等于<inputname="**M">里的值。希望大家能够帮助她。

详细问题描述及疑问:<inputname="**M"type="hidden"value="20">
<divstyle="color:#FF00FF"id="S_1">3</div>
<divstyle="color:#FF00FF"id="S_2">4</div>
<inputtype="button"value="减一"onclick="**M(1)">
<inputtype="button"value="减二"onclick="**M(2)">

<scriptlanguage="j**ascript">
Function**M(n)
{

……需要补充代码……

document.getElementById("S_"+n).innerText=M;
}
</script>


要求:
1、“点击』次<inputname="**M">里的值就减去“n”;
2、“M”的等于<inputname="**M">里的值。期待您的答案,真心佩服你,谢谢 !

希望以下的回答,能够帮助你。

第1个回答

用户名:china_chenshu  

function**M(n){
vartemp1;
temp1=Number(document.getElementById("S_"+n).innerText)-n;
alert(temp1);
document.getElementById("S_"+n).innerText=temp1;
}


告诉你,那个function的f不能大写