has

英[həz] 美[hæz]

v.Have (the third person singular of have); (in a kinship relationship) accept; take; Buy

jquery has() method syntax

Function:has() Reduces the set of matching elements to a subset that has descendants that match the specified selector or DOM element.

Syntax:.has(selector)

Parameters:

Parameter Description
selector String value, containing the selector expression of the matching element.

Description:If a jQuery object representing a collection of DOM elements is given, the .has() method constructs a new one using a subset of matching elements. jQuery object. The selector used is used to detect the descendants of the matching element; if any descendant element matches the selector, that element will be included in the result.

jquery has() method example

     
  • Does the UL contain an LI?
Run instance »

Click the "Run instance" button to view the online instance