How to Check if Element is Exists or not in jQuery?

By Hardik Savani | April 13, 2016 | | 28102 Viewer | Category : Javascript jQuery

Most of the time we require to check specific element is exists or not in javascript. but jquery provide length() method that can help to check element is exists or not. If you are new and want to do this then see bellow example:


<script type="text/javascript">


if ($('.image').length) {

console.log('yes, Image class is exists.');

} else {

console.log('sorry, Image class is not exists.');




***Do you want me hire for your Project Work? Then Contact US.