Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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" );
 
PREVIOUS NEXT
Tagged: #select #element #jquery
ADD COMMENT
Topic
Name
8+9 =