getElementById()
Posted: Mon Jan 16, 2006 11:56 am
OK, say I have a list setup like this...
And I want the <li> tags with the "hidden" id to be hidden when the page loads, but show up if the user clicks a certain button... I thought I could accomplish this with something like this...
But it only hides the first instance of id "hidden"
Anybody know how I can accomplish this?
PS... Sorry for being snippy the other day to those who were trying to help.... BAD DAY. Thanks in advance.
Code: Select all
<ul class="bulleted">
<li class="smallmargin">Intel Celeron 2.66GHz Processor</li>
<li class="smallmargin" id="hidden">533 MHz Front-side Bus</li>
<li class="smallmargin">512MB DDR 400 RAM</li>
<li class="smallmargin">80GB SATA Hard Drive</li>
<li class="smallmargin">17" CRT monitor</li>
<li class="smallmargin">High Speed CD Burner</li>
<li class="smallmargin" id="hidden">107 Key Keyboard</li>
<li class="smallmargin" id="hidden">Optical 3-Button Scroll Mouse Combo</li>
<li class="smallmargin" id="hidden">Six Total USB 2.0 Ports (4 Rear, 2 Front)</li>
<li class="smallmargin" id="hidden">3.5" Floppy Drive</li>
<li class="smallmargin">SiS Onboard 3D Video/Graphics Adapter</li>
<li class="smallmargin" id="hidden">6 Channel 32 Bit Digital Sound</li>
<li class="smallmargin" id="hidden">56k v.92 Fax Modem</li>
<li class="smallmargin">10/100 LAN Port</li>
<li class="smallmargin">Creative Stereo Speakers</li>
<li class="smallmargin">Windows XP Home</li>
<li class="smallmargin">1 year carry-in warranty </li>
</ul>Code: Select all
function hideAttribs(){
document.getElementById("hidden").style.visibility = "hidden";
document.getElementById("hidden").style.height = "auto";
}Anybody know how I can accomplish this?
PS... Sorry for being snippy the other day to those who were trying to help.... BAD DAY. Thanks in advance.