javascript - How to check an id in a webpage is there or not using jquery -


can tell me how know if id tag in webpage present or not. suggest using jquery.

use length property of jquery object. amount of elements found selector. there no need use > 0 too, because 0 interpreted false.

if( $("#myid").length ) {     // available } 

Comments

Popular posts from this blog

PHP while loop dynamic rowspan -

timer - Java TimerTask cancel -

android - How to read a column value in parse.com without accessing an object or a pointer -