Thursday, December 29, 2011

Javascript: Hiding Button By ID

from http://www.coderanch.com/t/121579/HTML-CSS-JavaScript/hide-button-javascript

how to hide button using javascript

hani Ibrahim
Ranch Hand

Joined: Sep 06, 2006
Posts: 171 
Dear all,
i have 3 buttons X,Y,Z what i want:
1) initially to hide Y,Z and show X
2)if i press on Y i hideX and Z
3) if i press on Z show just X
how is that please
Daesung Park
Ranch Hand

Joined: Mar 22, 2007
Posts: 68 
You can set "visibility" property of style.
  1.  document.getElementById('x').style.visibility='hidden'// hide  
  2. document.getElementById('x').style.visibility='visible'// show   

No comments:

Post a Comment