I have a loop that dynamically populates information.
<div class="main">
<div class="more">
more
</div>
<span></span>
....
<div class="more">
more
</div>
<span></span>
</div>
on clicking specific div I am calling "ajax" - on success I want to override that specific div's content and next span with some content.
$(document).on("click", ".more", function (event) {
$.ajax({
url: '..',
datatype: 'application/json',
success: function (data) {
$(".more",this).html("Update Dev"); //update div
$(".more",this).find('span:first').text("Update Span"); //update span
},
error: function () { alert('something bad happened'); }
});
});
How would I access the element that was clicked.
Thanks