You need a hash symbol for your button selector, and change the toggle
to click:
$("#dt-link1").click(function() {
$('#jqdt').find('ol li:eq(0)').css("color","Blue");
return false;
});
on 11/01/2010 22:45 JQueryNewbie said::
I cant get my color change on my listitem. any help would be
appreciated. Thanks in advance.
<head>
<title></title>
<script src="scripts/jquery-1.3.2.js" type="text/javascript"></
script>
<script type="text/javascript">
$(document).ready(function() {
$("dt-link1").toggle(function() {
$('#jqdt').find('ol li:eq(0)').css("color","Blue");
return false;
});
});
</script>
</head>
<body>
<div id="jqdt">
<ol>
<li>list item 1 with dummy link to silly.pdf </li>
<li>list item 2 with class="goofy" </li>
<li>list item 3 SURPRISE! </li>
<li>list item 4 with silly link to silly.pdf </li>
</ol>
</div>
<br/>
<button id="dt-link1" type="button">toggle first list item</button>
<button id="dt-link2" type="button">toggle first li even</button>
</body>