Code to apply multiple CSS property for a single item

Pgayath
Posted by Pgayath under jQuery category on | Points: 40 | Views : 952
<html>
<head>
<title>Multiple style to single element</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",
"background-color":"green"});
});
</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