jQuery has method


jQuery has method is used to get the elements which contains the particular element inside it.


Syntax : jQuery has method

$(selector).has(element);

element: Pattern to match the elements which has the supplied element in has method.

jQuery has Example

jQuery has() Method – Example

<script type="text/javascript">
         $(document).ready(function(){ 
              $("li").has("ul").css("border","3px solid black");               
          });
</script>

Try it »


Advertisements

Add Comment

📖 Read More