When the user clicks a button on my page, the content of a div should be cleared. How would I go about accomplishing this?
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.
Just Javascript (as requested)
Add this function somewhere on your page (preferably in the
<head>)Then add the button on click event:
In JQuery (for reference)
If you prefer JQuery you could do: