I have a grid with values
I need to disable the textbox with ID as minutes for 2nd row. Following sample does not work.
document.getElementById("h_ID")[2].readOnly = true;
Can someone help me with the syntax?
I have a grid with values
I need to disable the textbox with ID as minutes for 2nd row. Following sample does not work.
document.getElementById("h_ID")[2].readOnly = true;
Can someone help me with the syntax?
Only one element can have a given id in a HTML document.
That's why document.getElementById("minutes")
doesn't return a collection but a unique element. Don't use id in your case but classes.
So your code will be
document.getElementsByClassName("minutes")[2].readOnly = true;
document.getElementById
returns only one element, because you are not supposed to have more than one element with an id on the page. Switch all the id="minutes"
to class="minutes"
and then use:
document.getElementsByClassName('minutes')[2].readOnly = true;