If you need to remove the onclickon-demand attribute , use
$('#id_button').removeAttr('onclick').click(function(){
});
Take a second look at the selector. You need to request IDyour fragment is trying to select mybuttonas an identifier, which is the name of the element.
jAndy source
share