i want to use JQuery append function to append a button after a button.plz help
var button = $("<button>Hi there</button>");
button.click(function() {
alert("Hi back!");
});
button.appendTo("#tablecell");
the above code is used to append a button after some text in a table.but i want to append button after a button
or
Why You need
.on()delegateBecause your button, append to DOM after page load that means after DOM ready. So ordinary binding will not work there and you need delegate (aka, live) event handler.
but
you’ve another option
.delegate()which looks: