CodeToFun
Learn Programming Free
Tutorials
Languages
Features
About
Sign In
Tutorials
Languages
Features
About
Sign In
Back
/
jQuery .html() Method
jQuery .html() vs .text() — XSS safety (Try It)
Try It
Run
Reset
Save
Save to Google Drive
Sync with your Google account
Download HTML
Save to your device
Share
Full
HTML Code
Copy
html vs text safety
#unsafe — .html(userInput)
#safe — .text(userInput)
Insert sample malicious string
Demo uses harmless markup — real XSS would execute scripts.
Lines:
0
| Characters:
0
Live Preview
Auto-refresh on Run