I don't know if this question has been asked here on SO, i just don't know the right word.
I have this input tag:
<input type = "text" class="inputbox holdout-7"></input>
How do I get the holdout's value of 7 from the class using javascript?
This is because I wanted to add custom attributes but when the page is rendered, my custom attribute is not displayed. Some advised me to put them in a class instead.
For example:
<input type = "text" class = "inputbox" holdout="7"></input>
when the page is rendered, the holdout is not included, therefore I cannot get the value.
<input>elements do not have closing tags, secondly you should prependdata-to any custom attributes e.g.data-holdout="7"<input type="text" class="inputbox" data-holdout="7">