The length attribute determines the existence of a jquery object

  • 2020-03-26 21:29:11
  • OfStack

 
//Jquery determines whether an object exists by getting the length of the object
function testJquery() { 
if ($(".tel").length > 0) { 
alert(" There are "); 
} 
else { 
alert(" There is no "); 
} 
} 

Related articles: