In JavaScript to check whether an element exist or not we can use something like this

But in case of jQuery to check an element exist or not the code can be written like this

We can also…