Below is a simple function that can tell you if a specific ID exists or not :
function id_exists(id) { if ($("#"+id).length == 0) { return false; } return true; }
How to check if an id exists using jQuery
Below is a simple function that can tell you if a specific ID exists or not :
function id_exists(id) { if ($("#"+id).length == 0) { return false; } return true; }
Talk icons
– in the article above, point your mouse over them to reply.
Can't find a relevant Talk icon for what you have to say?
See how you can add one...
Note: All the talks and replies are also listed below.
Rating: (0+, 0-) In: jQuery