To remove an inline attribute using jQuery:
$('#tableA').find('#expand_' + row_id).removeAttr('onclick');
However, for IE <9, you should use:.prop('onclick', null);
As explained in the docs .
However, I wonder why you are using findwith an identifier selector. I believe that I am right in saying findreturns an array of jQ objects. Not a single DOM object.
Maybe:
$('#expand_' + row_id).prop('onclick', null);
. onclick , 2 prop , :
$('#expand_' + row_id).prop('onclick', 'expandAndShow('+row_id+')');
onclick, . , :
$('#tableA').on('click', '*[id^=expand_]', function()
{
alert($(this).attr('id').replace('expand_',''));
});
#tableA, , expand_. id, expand_.