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?
width()
height()
You can use length to see if your selector matched anything.
if ($('#MyId').length) { // do your stuff }
1.4m articles
1.4m replys
5 comments
57.0k users