4
I have several Ivs with the class prefix "webserver_[.. ]" and would like to check if any div with the prefix "webserver_[.. ]" exists, only with jQuery, how to do?
4
I have several Ivs with the class prefix "webserver_[.. ]" and would like to check if any div with the prefix "webserver_[.. ]" exists, only with jQuery, how to do?
5
You can use ^=
which is a pseudo-selector meaning that a given attribute "begins with" and so search for elements whose class starts with this string "webserver_".
Example:
$('[class^="webserver_"]').length // vai dar o numero de divs existentes
Browser other questions tagged javascript jquery
You are not signed in. Login or sign up in order to post.