Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jQuery Get 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; } #output { margin-top: 20px; padding: 10px; background: #eef; border-left: 4px solid #00f; } button { padding: 10px 15px; background: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; } button:hover { background: #0056b3; } </style> </head> <body> <h1>jQuery Get Text Example</h1> <p>jQuery get text content of an element using text() method.</p> <p id="textPara">This is some <strong>bold</strong> text inside the paragraph.</p> <button id="getTextBtn">Get Paragraph Text</button> <div id="output"></div> <script> $(document).ready(function(){ $("#getTextBtn").click(function(){ var paraText = $("#textPara").text(); $("#output").text("Paragraph Text: " + paraText); }); }); </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