Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jQuery Set Text Example</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <style> body { font-family: sans-serif; padding: 30px; background: #f9f9f9; } #textPara { margin-top: 20px; padding: 10px; background: #e0ffe0; border-left: 4px solid #080; } button { padding: 10px 15px; background: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; } button:hover { background: #218838; } </style> </head> <body> <h1>jQuery Set Text Example</h1> <p>jQuery set text content of an element using <kbd>text()</kbd> method.</p> <p id="textPara">This is the original text content.</p> <button id="setTextBtn">Set New Text</button> <script> $(document).ready(function(){ $("#setTextBtn").click(function(){ $("#textPara").text("This is the chagned text content using text() method."); }); }); </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