javascript - Custom attribute not working in IE10 -


i have input text type

<input type="text" name="firstnameind" style="width:200px;" required="true" maxlength="100" /> 

"required" custom attribute access using javascript.

this working fine in ie 7 , 8, not in ie10 shows required="".

might due required attribute in html5.

can 1 suggest do?

assuming html5 doctype, required attribute reserved. should use data- prefix custom attributes:

<input type="text" name="firstnameind" style="width:200px;" data-required="true" maxlength="100" /> 

which can access so:

var required = foo.getattribute('data-required') // foo reference input 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -