Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
18 Nov 2012deepak.m.shrma
$('.remove').click(function () {var postHTML = $(this).closest(".post").html(); // select closest div or element with class post });try this. its working fine.
15 Nov 2012Lubomur 4 alternatives
Hi, how can I select "post" div html() by click "remove".If I write $('post').html() select work only for first "post", but I need to select for example second or third.//html Some text for first div <a...
var post = $(this).parents().parents().html();
$('.remove').live('click', function () { $('.post:eq(1)').html(''); });Please try this this will give you the last div with class = post
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.