in the code below, I need to get the ID of the element that has raised the event
$(document).ready(function ()
{
$(".selectors").live('change', function ()
{
$.post("GetCategoriesByParentId/", { ID: $(this).val() }, function (data)
{
var idd = $(this).attr('id'); //here
});
});
});
but the idd is always ‘Undefined’. Why ?
In the context of the
$.postcallback, the value ofthiswill be set to something different to that of thelivecall. You’ll need to cache the value ofthis: