js input事件
比如,<inputtype="number"id="thousandOfNum1"onKeyUp="thousandOfNUmber(this.value)"\><inp...
比如,
<input type="number" id="thousandOfNum1" onKeyUp="thousandOfNUmber(this.value)" \>
<input type="number" id="thousandOfNum2" onKeyUp="thousandOfNUmber(this.value)" \>
<input type="number" id="thousandOfNum3" onKeyUp="thousandOfNUmber(this.value)" \>
thousandOfNUmber(value){
value = value + 1;
...
}
thousandOfNUmber方法怎么使得input显示对应的值,id名称不固定。。。 展开
<input type="number" id="thousandOfNum1" onKeyUp="thousandOfNUmber(this.value)" \>
<input type="number" id="thousandOfNum2" onKeyUp="thousandOfNUmber(this.value)" \>
<input type="number" id="thousandOfNum3" onKeyUp="thousandOfNUmber(this.value)" \>
thousandOfNUmber(value){
value = value + 1;
...
}
thousandOfNUmber方法怎么使得input显示对应的值,id名称不固定。。。 展开
展开全部
function thousandOfNUmber(obj){
obj.value = obj.value*1 + 1;
}
<input type="number" id="thousandOfNum1" onKeyUp="thousandOfNUmber(this)" />
<input type="number" id="thousandOfNum2" onKeyUp="thousandOfNUmber(this)" />
<input type="number" id="thousandOfNum3" onKeyUp="thousandOfNUmber(this)" />
obj.value = obj.value*1 + 1;
}
<input type="number" id="thousandOfNum1" onKeyUp="thousandOfNUmber(this)" />
<input type="number" id="thousandOfNum2" onKeyUp="thousandOfNUmber(this)" />
<input type="number" id="thousandOfNum3" onKeyUp="thousandOfNUmber(this)" />
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询