How To Add A New Attribute To A Tag
In some HTML, I saw the input tag has the attribute verify. How to add it to the input tag? I tried the code a
Solution 1:
If you mean to say that the html input element has a [verify]
attribute, then you can access the attribute via getAttribute()
:
<inputid="test" verify="test" />
JS:document.getElementById('test').getAttribute('verify'); //test
Post a Comment for "How To Add A New Attribute To A Tag"