DEV Community

Discussion on: Why do you use jQuery in 2019?

Collapse
 
niorad profile image
Antonio Radovcic

It still has some advantages. If you do

const a = document.querySelector(`a`)

And then try to use a, it will throw an exception. With jQuery it just fails silently. This can be a pro or a con depending on your use case.

Also a good thing to use it for is when you receive a bunch of HTML in a string from a server and want to insert it into your document.