I know that you can test for width() or height() but what if the element's display property is set to none? What other value is there to check to make sure the element exists?
Assuming you are trying to find if a div exists
$('div').length ? alert('div found') : alert('Div not found')
You can use the visible selector: