$("#pm-table").on("click", ".pm_auto_complete", function(){ Instead of the selecting the button itself, the parent element should be selected. Then select the class/id of the element in the ON event.