The following jQuery code is designed to hide elements within a paragraph (<p>) tag when a button is clicked.
![Screenshot of webpage with text and button Screenshot of webpage with text and button](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFGqaKkK2KKrW98jrNiZFff1m6kXxl2sVPB3gxVbk8QqFEjfdJPHjGHvSLjAvmCV4vhxYuCthUoug0y2FNzKU0Kd4vXcTJeUodKOmdd6_irqwTmpRAYswYrInSVB1mjPeRNCAs0yVzhnQF/s1600/Hide+text.PNG) |
Screenshot of webpage with text and button |
We make use of the '
click' method to create a function that runs when the button is clicked to then '
hide' all <p> elements on the webpage.
Hide text with a button in jQuery
No comments:
Post a Comment