jQuery is () method
Examples
If <p> parent element is <div> element, the pop-up message:
if ($ ( "p"). parent (). is ( "div")) {
alert ( "p is the parent element div");
}
alert ( "p is the parent element div");
}
try it"
Definitions and use
Whether is () method is used to view the selected element matches the selector.
grammar
$ (Selector) .is (selectorElement,function (index, element))
parameter | description |
---|---|
selectorElement | have to. Selector expression, according to selector / element / jQuery object inspector set of matched elements, if there is at least one matching element, it returns true, false otherwise |
function (index, element) | Optional. Select the element group specified function to be executed.
|