/ Published in: JavaScript
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 /*The .length property in jQuery returns the length or number of elements inside an array or the string length. If you want to check the existence of the element, just check if the returned value of length is zero:*/ if ($(selector).length) { //your code here }
Comments
                    Subscribe to comments
                
                