Answers for "how select just before element in jquery"

1

how select just before element in jquery

<ul>
  <li>list item 1</li>
  <li>list item 2</li>
  <li class="third-item">list item 3</li>
  <li>list item 4</li>
  <li>list item 5</li>
</ul>
$( "li.third-item" ).prev().css( "background-color", "red" );
Posted by: Guest on April-25-2021

Code answers related to "how select just before element in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language