Answers for "has element jquery"

0

has element jquery

// html
 <ul>
  <li>list item 1</li>
  <li>list item 2
    <ul>
      <li>list item 2-a</li>
      <li>list item 2-b</li>
    </ul>
  </li>
  <li>list item 3</li>
  <li>list item 4</li>
</ul>

//jquery
$( "li" ).has( "ul" ).css( "background-color", "red" );
Posted by: Guest on September-17-2021

Code answers related to "has element jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language