By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,086 Members | 1,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,086 IT Pros & Developers. It's quick & easy.

Make all buttons disappear, not only the one clicked

P: 1
Hello all,

I'm very new to java script and I need help.

I have a couple of buttons on a page that I need to disappear when one of the buttons is clicked. What I found is this:

onclick="this.setStyle('display', 'none')

It works great, but only for the button that is clicked. How would I make it for all the buttons to disappear?

Also, what is a good place for complete online documentation of JavaScript?
Mar 9 '08 #1
Share this Question
Share on Google+
2 Replies


hsriat
Expert 100+
P: 1,654
Hello all,

I'm very new to java script and I need help.

I have a couple of buttons on a page that I need to disappear when one of the buttons is clicked. What I found is this:

onclick="this.setStyle('display', 'none')

It works great, but only for the button that is clicked. How would I make it for all the buttons to disappear?
In the above code, you are applying display:none style only to the button pressed. Make a function which hides all the buttons and call that function onclick of all the buttons.

Also, what is a good place for complete online documentation of JavaScript?
For a beginner, I recommend w3schools
Mar 9 '08 #2

acoder
Expert Mod 15k+
P: 16,027
Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions. Thanks!
Mar 9 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.