I have a form where the class of the button is dynamically changing, depending up where the request is coming from. I am trying to capture the onclick event, but it does not tak
Thats cause when you bind the click event the element has another class.
Try somesthing like this:
$('body').on('click', '.newClass', function () { alert('test'); });
Example