how select just before element in jquery

Solutions on MaxInterview for how select just before element in jquery by the best coders in the world

showing results for - "how select just before element in jquery"
Lou
07 Apr 2020
1<ul>
2  <li>list item 1</li>
3  <li>list item 2</li>
4  <li class="third-item">list item 3</li>
5  <li>list item 4</li>
6  <li>list item 5</li>
7</ul>
8$( "li.third-item" ).prev().css( "background-color", "red" );