Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
259 views
in Technique[技术] by (71.8m points)

input输入框格式监听

想对input框做正确的数字格式校验,比如我在input框中输入了“0.”,然后监听键盘按下的时候获取到input的值却为“0”,也就是没有我输入的“.”(小数点),请问该如何获得这个小数点,这样我才能判断获取到的值中有这个“.”,之后的处理就是不能再输入“.”

求助!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

监听oninput事件来处理


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...