I am writing a JavaScript library to validate the form, and I am thinking about the correct markup syntax. Say I have an entrance that requires a number from 1,000 to 10,000.
So far I have come up with something like this:
<input class='validate required number' min='1000' max='10000' />
Is this the right way to do this? Here I have two problems:
- I don't like classes. This is like abuse. Can I use them like this?
- My custom attributes
minand maxare not checked.
source
share