【发布时间】:2011-01-19 14:43:38
【问题描述】:
我正在编写自定义表单验证 javascript 库,并且正在考虑正确的标记语法。假设我有一个输入需要 1 000 到 10 000 之间的数字。
到目前为止,我想出了这样的事情:
<input class='validate required number' min='1000' max='10000' />
这是正确的做法吗?我这里有两个问题:
- 我不喜欢使用类。感觉像是误用。像这样使用它们可以吗?
- 我的自定义属性
min和max未验证。
【问题讨论】:
-
重复或至少相关:检查stackoverflow.com/questions/1600106/…
标签: xhtml attributes markup custom-attributes