Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jQuery context Property Example</title> <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <style> body { font-family: Arial, sans-serif; padding: 10px; } .demo-box { border: 1px solid #ccc; padding: 15px; margin-bottom: 10px; } ul { padding-left: 20px; } li { margin: 4px 0; } .highlight { background: #f0f8ff; padding: 5px; } </style> </head> <body> <h2>jQuery <code>context</code> Property Example</h2> <div class="demo-box"> <p>Click the button to show the context used by jQuery selections.</p> <button id="showContext">Show Context</button> <ul id="resultList"></ul> </div> <script> $(document).ready(function() { $("#showContext").click(function() { // Example 1: Default document context var defaultCtx = $("ul").context; // usually HTMLDocument $("#resultList").append("<li class='highlight'>Default context: " + defaultCtx + "</li>"); // Example 2: Custom node context var customCtx = $("ul", document.body).context.nodeName; // BODY $("#resultList").append("<li class='highlight'>Custom context: " + customCtx + "</li>"); }); }); </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