Hello, I am having some trouble with jQuery.
I am making a simple CMS and in the interface I have a list of pages, in each list item is an edit link. I made jQuery listen for clicks with that edit id. It will then look at the parent LI to see what id it has so the user can save the changes to the right pageId in the database.
My List
<ul id="sortable" class="ui-sortable">
<li class="sortable" id="listItem_1">
<a href="#" id="edit">edit</a>
<span id="title">List item 1</span>
</li>
<li class="sortable" id="listItem_2">
<a href="#" id="edit">edit</a>
<span id="title">List item 2</span>
</li>
etc..
</ul>
And the javascript
<script type="text/javascript">
$(document).ready(function() {
$('a#edit').click(function(){
alert($(this).parent("li").attr("id"));
})
});
But only the first edit link works. All the others just get ignored. You can see the problem working here, http://info.radio-onair.ath.cx/active/scms/admin/pages/test.html
Thanks in advance.