Question: Create a Web page that contains a button that when clicked toggles the visibility on and off of a div element with some content. Do
Create a Web page that contains a button that when clicked toggles the visibility on and off of a div element with some content.
Do not use jQuery or any other third party library; use only the browser's native Javascript interface.
Javascript objects representing HTML elements have a style attribute that allows you to change the CSS rules applied to the element. With this you can change the visibility of an element as follows.
element.style.visibility = 'visible'; element.style.visibility = 'hidden';
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
