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 -

javascript - image slideshow using canvas HTML5 -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -