![showhide javascript showhide javascript](https://community.dynamics.com/cfs-file/__key/communityserver-discussions-components-files/117/codng.png)
![showhide javascript showhide javascript](https://www.tutorialfunda.com/wp-content/uploads/2020/09/Show-Hide-Elements-in-JavaScript-1.png)
![showhide javascript showhide javascript](https://i.stack.imgur.com/5PmrN.png)
The difference between the style.display and style.visibility is when using. Then we can add the following JavaScript code: const button = document.querySelector('button') const p = document.querySelector('p') button.addEventListener('click', () => )Īnd we get the same result in our example. The visibility property in JavaScript is also used to hide an element.