You need to call your plugin manually, as custom
options will not work with data-attributes:
$().validator({
custom: {
'odd': function($el) { return Boolean($el.val() % 2);}
}
})
then use it like this:
<input placeholder="plz enter odd value" data-odd>
Don't forget to add error messages, see code
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…