Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>jQuery $.parseJSON() Example | TutsInsider</title> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <style> body { font-family: Arial, sans-serif; background: #f9f9f9; padding: 10px; } h2 { color: #2a73cc; } #parseBtn { background: #2a73cc; color: #fff; border: none; padding: 10px 20px; cursor: pointer; margin-top: 10px; font-size: 16px; } #output { border: 1px solid #ccc; background: #fff; padding: 15px; margin-top: 20px; } </style> </head> <body> <h2>jQuery $.parseJSON() Example</h2> <p>This example shows how to convert a JSON string into a JavaScript object using <kbd>$.parseJSON()</kbd>.</p> <button id="parseBtn">Parse JSON</button> <div id="output">Parsed data will appear here.</div> <script> $(function() { $('#parseBtn').on('click', function() { var jsonString = '{"name":"John Doe","age":30,"skills":["JavaScript","jQuery","PHP"],"active":true}'; // Parse JSON string var obj = $.parseJSON(jsonString); $('#output').html( 'Name: ' + obj.name + '<br>Age: ' + obj.age + '<br>Skills: ' + obj.skills.join(', ') + '<br>Active: ' + (obj.active ? 'Yes' : 'No') ); }); }); </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