get the last class of clicked element with multiple class jquery code example
Example: jquery is triggered on every element with class name
$(".yourButtonClass").on('click', function(event){
event.stopPropagation();
event.stopImmediatePropagation();
//(... rest of your JS code)
});