HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> <body> <h1>jQuery off() Method</h1> <p>Try to click on this paragraph</p> <button>p off</button> <div>paragraph click : <strong>Enabled</strong></div> <script> $(document).ready(function(){ $("p").click(function(){ alert("You Clicked the Paragraph."); }); $("button").click(function(){ $("p").off("click"); $("strong").text("Disabled") }); }); </script> </body> </html>
OUTPUT
×

Save as Private