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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -