I have a button that I’m trying to hide once clicked. Also I just don’t want to hide it I want it to style='display:none' once clicked.
I have a button that I’m trying to hide once clicked. Also I just
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update 2020:
With
addEventListener()andquerySelector()being supported in all major browsers, it can just beAnswer in 2012:
To make it unobtrusive and work on earlier IE and other modern browsers:
the HTML:
JavaScript:
Note that
addEventis a generic function that works well on earlier IE and other modern browsers. You can add other events similar to the last line of code above.Sample on http://jsfiddle.net/W37Fb/5/