Twitter Bootstrap onclick event on buttons-radio

后端 未结 9 1710
傲寒
傲寒 2020-12-13 03:51

I have a Twitter Bootstrap buttons-radio and hook an onclick event to it. But how do I check which of the buttons that got triggered?

My first thought was to simply

9条回答
  •  难免孤独
    2020-12-13 04:07

    I would use a change event not a click like this:

    $('input[name="name-of-radio-group"]').change( function() {
      alert($(this).val())
    })
    

提交回复
热议问题