Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html> <head> <title>jQuery die() Method Example</title> <script src="https://code.jquery.com/jquery-1.6.4.min.js"></script> <!-- Use jQuery <1.7 --> <style> .box { padding: 10px; margin: 5px; background-color: #cfd8dc; border-radius: 4px; cursor: pointer; width: 200px; } button { margin-top: 10px; padding: 8px 16px; } </style> </head> <body> <h2>jQuery die() Method</h2> <div class="box">Click me 1</div> <div class="box">Click me 2</div> <button id="remove">Disable Clicks using die()</button> <script> // Attach event using .live() $('.box').live('click', function() { alert($(this).text()); }); // Remove event using .die() $('#remove').click(function() { $('.box').die('click'); alert('Click event removed!'); }); </script> </body> </html>
Editor Commands
Ctrl
F
Find
Ctrl
G
Find Next
Ctrl
⇧
G
Find Previous
Ctrl
⇧
F
Find & Replace
Ctrl
]
Indent Code Right
Ctrl
[
Indent Code Left
⇧
Tab
Auto Indent Code
Ctrl
/
Line Comment
Ctrl
Alt
/
Block Comment
TutsInsider Actions
Alt
S
Run Code
Ctrl
C
Copy Editor Code
Ctrl
A
Select All Editor Code
Ctrl
S
Save/Download
Ctrl
Alt
X
Rotate
Ctrl
Alt
T
Switch Theme
Ctrl
⇧
C
Open Console
Esc
Close Console