Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding a checkbox 2

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
US
Hi,
what is the way to hide the label corresponding to the checkbox in checkbox list. I was able to hide a checkbox (by accessing it by id) but label does not have an id, so the text stayed. How to get around it? Or is there a better way to hide the whole checkbox element with label and everything instead of hiding those separately? Here is the HTML source. Thanks!!
<table id="f_f10008338_s_f41764_0" class="lpp-ListTableTopVAlign" border="0">
<tr>
<td><input id="f_f10008338_s_f41764_0_0" type="checkbox" name="f:f10008338:s:f41764_0:0" /><label for="f_f10008338_s_f41764_0_0">Annuities Booklet</label></td>
</tr><tr>
<td><input id="f_f10008338_s_f41764_0_1" type="checkbox" name="f:f10008338:s:f41764_0:1" /><label for="f_f10008338_s_f41764_0_1">Cd Booklet</label></td>
 
[tt]var oelem=document.getElementById("f_f10008338_s_f41764_0").parentNode; [green]//1st input checkbox for instance[/green]
oelem.style.display=(oelem.style.display=="none")?"block":"none"; [green]//toggling[/green]
[/tt]
 
You can assign an ID to the label if you need to, that still adheres to XHTML 1.0 strict
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top