Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since 5 years everybody says Jquery us no longer necessary. But really baisc function like this take a long time for replacing Jquery


jQuery does not sanitize HTML. This is why jQuery is no longer necessary, even if people think it is.


There is the jquery bashing again. let sanitizedHTML = $('<div>').text(unsanitizedHTML).html();


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: