Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>jQuery Plugin Example: Highlight</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <style> body { font-family: Arial, sans-serif; background: #f9f9f9; padding: 40px; text-align: center; } h2 { color: #2c3e50; margin-bottom: 10px; } p.description { color: #555; max-width: 600px; margin: 0 auto 30px; font-size: 15px; } .note { display: inline-block; padding: 15px 25px; margin: 10px; border: 2px solid #ccc; border-radius: 5px; background: #eee; cursor: pointer; transition: background 0.3s ease, color 0.3s ease; } .note:hover { background: #dcdcdc; } </style> </head> <body> <h2>jQuery Plugin Example: Highlight</h2> <p class="description"> This example demonstrates a custom jQuery plugin <code>highlight()</code> that changes the background color of elements. </p> <div class="note">Note 1</div> <div class="note">Note 2</div> <div class="note">Note 3</div> <script> (function($) { $.fn.highlight = function(color = 'yellow') { return this.each(function() { $(this).css('background', color); }); }; })(jQuery); // usage: highlight all .note elements when clicked $(document).ready(function() { $('.note').click(function() { $(this).highlight(); }); }); </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