sudhakarinfotech
(current)
Run Code
Live Code Editor- jQuery Show Hide Parameters
Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>jQuery Show And Hide Effects</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <style> p{ padding:20px; background: green; color:white; font-size:25px; } .btn-show-effect,.btn-hide-effect{ padding:10px 15px; background-color:black; color:white; border:none; border-radius:5px; margin:15px 10px; } </style> <script> $(document).ready(function(){ // Hide displayed paragraphs $(".btn-hide-effect").click(function(){ $("p.fast-speed").hide("fast"); $("p.slow-speed").hide("slow"); $("p.very-fast-speed").hide(200); $("p.very-slow-speed").hide(3000); }); // Show hidden paragraphs $(".btn-show-effect").click(function(){ $("p.fast-speed").show("fast"); $("p.slow-speed").show("slow"); $("p.very-fast-speed").show(200); $("p.very-slow-speed").show(3000); }); }); </script> </head> <body> <h1>jQuery Show Hide Parameters</h1> <button type="button" class="btn-show-effect">Show Paragraphs</button <button type="button" class="btn-hide-effect">Hide Paragraphs</button> <p class="fast-speed">This is first paragraph.</p> <p class="slow-speed">This is second paragraph.</p> <p class="very-fast-speed">This is third paragraph.</p> <p class="very-slow-speed">This is fourth paragraph.</p> </body> </html>
Source Code Output :
Running