For example I have html elements like
<input type="radio" name="disableme" id=1> Animal
<input type="radio" name="disableme" id=2> Mammal
<input type="radio" name="disableme" id=3> Human
I tried like , document.formName.disableme.disabled = true; But it didn’t worked..
I can do it using Id. But I need it in one shot.
Please help.
Because if you have more than one form control with the same name, you will get back an HTML Form Controls Collection. So loop over the collection:
There is no need to add an ID.