Is () function
Determines whether the current object conforms to the specified expression
Grammar
$selector. is (expression)// Specify an expression
return value
The return value is a Boolean type (True/false)
Returns true whenever an arbitrary element satisfies a specified expression when the current object contains more than one element
Example description
Code
1<! DOCTYPE html>234<script src= "Http://libs.baidu.com/jquery/1.10.2/jquery.min.js" ></script>5 67<body>8<div></div>9<div id= "Div" ></div>Ten<div> One<ul> A<li>one</li> -<li id= "Both" class= "Li" >two</li> -<li>three</li> the</ul> -</div> -<script> -Document.writeln ($ ("#two"). Is ("Li"));//returns True +Document.writeln ($ ("Li"). Is ("UL"));//returns false -Document.writeln ($ ("#div"). Is ("div"));//returns false because the class name is not in the Id=div object +</script> A</body> at
Run results
King_dream
2015-04-16 17:27:27
Jquery.is () function