摘要:
1:js 字符串长度限制、判断字符长度、js限制输入、限制不能输入、textarea 长度限制 2.:js判断汉字、判断是否汉字 、只能输入汉字 3:js判断是否输入英文、只能输入英文 4:js只能输入数字,判断数字、验证数字、检测数字、判断是否为数字、只能输入数字 5:只能输入英文字符和数字 6: js email验证 、js 判断email 、信箱/邮箱格式验证 7:js字符过滤,屏蔽关键字 ... 阅读全文
摘要:
本文介绍如何创建一个可用于任何Web页面的“正则表达式库”——通过将表单验证代码保存为一个独立的文件,我们可以避免为不同表单重写类似的验证代码,只需在HTML页面中包含这个库文件即可。 一、HTML元素属性与JavaScript对象属性 我们知道,HTML允许我们为元素指定自定义属性。如对于表单中的文本输入框元素,我们可以给它指定一个称为... 阅读全文