Use jquery.min.js when you working with jQuery
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Follow the example code:
HTML Code:
<!DOCTYPE html> <html> <head> </head> <body> <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> <button id="hideText">Hide Text</button> <button id="showText">Show Text</button> </body> </html>
jQuery Code:
<script> $(document).ready(function(){ $("#hideText").click(function(){ $("p").hide(); }); $("#showText").click(function(){ $("p").show(); }); }); </script>
Question and answer is powered by AnsPress.io