html - Select an element without ID in JavaScript -


this question has answer here:

i'm having little problem changing value of textbot. problem there no id assigned textbox, getelementbyid not work, neither getelementsbyname.

<input type="text" class="textbox" name="custom_reason" size="50" maxlength="120" value=""> 

how change it's value?

thank you.

you may use name instead:

var x = document.getelementsbyname("custom_reason")[0]; 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -