By calling .toggle() or .fadeToggle() with jQuery we can toggle visibility of an element easily.
Watch this video:
Here is the complet source code:
<!DOCTYPE html> <html> <head> <title>ZK Tutorials</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><!-- <---that is JQuery link, you must include it from CDN or local JQuery js file. --> </head> <body> <h1>JQuery Toggle</h1> <!-- I'm going to add a paragraph element with an ID --> <p id="myelement">This is my element</p> <!-- Let's open it on a browser. --> </body> </html>