$('PARENT_ELEMENT').on('click','a[rel=XYZ]',function (e) {
$(this).replaceWith('some html');
});
Just make sure that 'PARENT_ELEMENT'
exist when you bind your event. Safest way is to use 'body'
or document
as 'PARENT_ELEMENT'
.
$('PARENT_ELEMENT').on('click','a[rel=XYZ]',function (e) {
$(this).replaceWith('some html');
});
Just make sure that 'PARENT_ELEMENT'
exist when you bind your event. Safest way is to use 'body'
or document
as 'PARENT_ELEMENT'
.