Code to apply CSS to a particular item in the list using jQuery.

Pgayath
Posted by Pgayath under jQuery category on | Points: 40 | Views : 1038
<html>
<head>
<title>CSS </title>
<script type="text/javascript" src="/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$("li").eq(2).css("color", "red");
});
</script>
</head>
<body>
<div>
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>
</div>
</body>
</html>

Comments or Responses

Login to post response