# How does jQuery.eq() method work in jQuery?

If you want to return an element with a definite index number of the selected elements, then use the eq() method. The first element has index 0, the second element has index 1, etc. Yes, the index number starts at 0.

## Example

You can try to run the following code to learn how to work with jQuery.eq() method,

Live Demo

<!DOCTYPE html>
<html>
<script>
$(document).ready(function(){$("p").eq(3).css("background-color", "gray");
});
</script>