I got inputs inside button. Is it possible to prevent triggering button click event when clicking on input? preventDefault() does not work.
<button class="btn_size">
<input type="text" name="size_y" style="width:60px;" />
<font style="font-weight:normal;">x</font>
<input type="text" name="size_y" style="width:60px;" />
Set size
</button>
The same happens with stopPropagation(). It does not stop it:
Few years ago I had similar problem. I wanted to be able to disable single accordion button. I wrote a function that was able to bind event at the top of any other events, and it just checked if clicked button had .disabled class. If yes, it simply did return false;. That worked. But only until jQuery 1.8 came up. Something changed in the access to event data, and it does not work anymore.
This question may seem to be easy, so I do aware that I may get alot of -1 votes. But please, check if You are able to resolve the problem, before voting.