Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to hide childNode i wrote javascript...

var combo = document.getElementsByName("abc");
combo[0].childNodes[3].style.display="None";

but i dont do it.

if i write combo[0].style.display="None"; all of childNode are hide but i want to hide one item.

How can i hide childNode ?
Posted
Updated 3-May-13 7:36am
v2
Comments
Mohibur Rashid 3-May-13 19:44pm    
I did not get your "all of childNode are hide but i want to hide one item." combo[0].style.display="None"; will hide only the first node. no exception. by the way, the options in the combobox are not child. if you want to remove a option from your combobox then
use combo[0].remove(index)
Ccsnow 4-May-13 1:55am    
Thank you... combo[0].remove(index)correct
Sandeep Mewara 4-May-13 2:08am    
Is your issue resolved?
Ccsnow 4-May-13 2:35am    
Yes Thank u

1 solution

Use 'id' in tag attribute (id='abc').

C#
var combo = document.getElementsByID("abc");
 combo[0].childNodes[3].style.display="None";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900