jquery get last ID of dynamic div
Posted
by Pjack
on Stack Overflow
See other posts from Stack Overflow
or by Pjack
Published on 2010-05-10T04:57:21Z
Indexed on
2010/05/10
5:18 UTC
Read the original article
Hit count: 332
Couldn't find an answer, but Im trying to get the last ID of the last div that was created on the page. The code I'm using doesn't seem to work using .last(). My syntax is probably wrong but I can't get it to show the ID.
jQuery(document).ready(function()
{jQuery("a.more_posts").live('click', function(event){
jQuery("div[id^='statuscontainer_']").last();
var id = parseInt(this.id.replace("statuscontainer_", ""));
alert(id);
});
});
© Stack Overflow or respective owner