
js
Programmer-Z
这个作者很懒,什么都没留下…
展开
-
回撤查询
$("#id").bind('keypress',function(event){ if(event.keyCode == '13'){ serch() }})原创 2019-12-19 14:00:28 · 161 阅读 · 0 评论 -
input[type=number]只能输入整数
html<input type="number" value="" oninput="test(event)"/>jsfunction test(e){ var value = e.target.value; value = value.replace( /\D+/, ""); if(value.length > 0){ if(value.len...原创 2019-12-16 11:25:07 · 5863 阅读 · 0 评论 -
限制input输入框的字数
如:限制输入500字html:<input id="" name="" onkeyup="checkLength(this,1000)">js: checkLength=function(dom,maxLength){ var l=0;for(var i=0;i<dom.value.length;i++){if(/[\u4e00-\u9fa5]/.t...原创 2018-09-06 10:03:07 · 4235 阅读 · 0 评论 -
js验证多个用分号隔开的邮箱
html:<body style="text-align: center;"> <h1>电子邮件地址验证程序</h1> 请输入电子邮件地址:<input id="email_address" type="text" style="width: 300px;" /><br /&g原创 2018-11-01 09:43:13 · 4018 阅读 · 1 评论