I use Bootstrap
and jQuery
. I have three buttons, each with an icon in it. When I bind an click
-event to a button, it works when I click on the button (on the edge), but not when I click on the middle of it, on the icon...
My code looks like this:
<div class="btn-group">
<button class="btn btn_change_status" id="134" rel="tooltip" data-original-title="Tooltip">
<i class="icon-eye-open"></i>
</button>
...
</div>
...
$('button.btn_change_status').on('click', function(e) {
alert(e.target.id);
return false;
});
How could I bind all elements wrapped by my btn_change_status
to the click-event?
You need a different syntax, as per the documentation:
Update your css with the following. I'm assuming you don't need mouse events on your icon.
MDN Information regarding pointer-events
Use the following syntax for .on()