Traversing in Jquery

<script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type = "text/javascript" language = "javascript">
$(document).ready(function() {
$("li").eq(4).addClass("selected");
});
</script><style>
.selected { color:blue; }
</style>

<ul>
<li>PHP</li>
<li>AJAX</li>
<li>JQUERY</li>
<li>MYSQL</li>
<li>ZEND</li>
</ul>

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *