jQuery(function ($) { $(".div").on("click","BUTTON", function (e) { alert(e.target.id.replace(/^.*[^\d]/, "")); }); });