Question: how to check if a jquery element exists?
Answer: Answer: Use the jQuery . length Property You can use the jQuery . length property to determine whether an element exists or not in case if you want to fire some event only if a particular element exists in DOM. Here's an example that displays an alert on button click if the specified element exists.