jQuery eq method


jQuery eq method() finds the element at specified index.


Syntax of jQuery eq Method

$(selector).eq(index);

Index :
– Index of element can be positive or negative number.

jQuery eq method Example 1

jQuery eq() Method – Example

<script type="text/javascript">
         $(document).ready(function(){ 
             $("li").eq(2).css("background","red");   
          });
</script>

Try it »


Advertisements

Add Comment

📖 Read More