Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ulrischa
14 days ago
|
parent
|
context
|
favorite
| on:
Element: setHTML() method
Since 5 years everybody says Jquery us no longer necessary. But really baisc function like this take a long time for replacing Jquery
halapro
14 days ago
[–]
jQuery does not sanitize HTML. This is why jQuery is no longer necessary, even if people think it is.
ulrischa
14 days ago
|
parent
[–]
There is the jquery bashing again. let sanitizedHTML = $('<div>').text(unsanitizedHTML).html();
wccrawford
14 days ago
|
root
|
parent
[–]
You can 100% do that same thing without jQuery. It's not even complicated.
And that is
not
what the new .setHTML() does.
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: