javascript - Getting the input tag(s) and setting them as unchecked -


i want write java script function input tag(s) type "checkbox" td , mark them unchecked. following jsp code:

<td id="uncheckedbydefault" align=center class=listtypeone>     <% if (priv.getviewprivilege() == 1) { %>     <input name="view" type="checkbox" value='<%= priv.getattributeid() %>' checked>                          <% } else { %>     <input name="view" type="checkbox" value='<%= priv.getattributeid()%>'>     <% } %> </td> 

now here td has id="uncheckedbydefault". want input tag(s) , set them unchecked. can tell how can that. in advance.

try:

inputs = document.getelementbyid('uncheckedbydefault').getelementsbytagname('input');      (index = 0; index < inputs.length; ++index) {         // deal inputs[index] element.        inputs[index].checked=false;     } 

Comments

Popular posts from this blog

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -