怎么实现点哪个框就在那个框输出。。。还有这个小数点怎么显示不了

Illegaler_xxxx Illegaler_xxxx 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
新手刚上手
<html>
<head>
<script language="javascript" type="text/javascript">
function btnNum_onclick(i)
{
var a1 = txtNum.value;
if(a1.length < 6)
{
txtNum.value = txtNum.value + i;
}
else
{
return;
}
}
function btnDelete_onclick()
{
var a2 = txtNum.value;
a2 = a2.substring("",a2.length - 1);
txtNum.value = a2;
}
</script>
</head>
<body>
<div >
<input id="txtNum" type="test" style="position:absolute; top:205px; width: 250px; height: 50px;"/>
<input id="txtNum1" type="test" style="position:absolute; top:305px; width: 250px; height: 50px;"/>
<div style="position:absolute;">
<input id="Button1" type="button" value="1" style="width: 60px; height: 60px;" onclick="return btnNum_onclick(1)" />
<input id="Button." type="button" value="." style="width: 60px; height: 60px;" onclick="return btnNum_onclick(.)" />
<input id="ButtonD" type="button" value="删除" style="width: 60px; height: 60px;" onclick="return btnDelete_onclick()"/>
</div>
</div>
</body>
</html>
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
Illegaler_xxxx
JavaScript 87,984 成员 224,680 内容