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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide All Combo Boxes (Select box)

Status
Not open for further replies.

vinayak

Technical User
Sep 17, 2001
50
IN
Hi,
Is there any way by means of which One can detect All Combo Boxes (Select box) in a web page and at the same time hide them. The combo box names are not known.

Thanks in Advance,
Vins
 
I'm not sure how cross browser this is but you could try.

Code:
var x = document.getElementByTag("select")

for (i=0;x && i < x.length; i++)
   x[i].style.display = none 
// or
// x[i].style.visibility = &quot;hidden&quot;

hope this helps

simon
 
here's simon's code minus the bugs ;-)
Code:
var x = document.getElementsByTagName(&quot;select&quot;);

for (i = 0; i < x.length; i++) {
   x[i].style.display = &quot;none&quot;;
// or
// x[i].style.visibility = &quot;hidden&quot;
}

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
>>Thanks Jeff - my stubby fingers cause my all these problems.


point taken :)

-kaht

banghead.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top