How to create a toggle button in Bootstrap

前端 未结 10 670
自闭症患者
自闭症患者 2021-01-30 00:57

I originally created a web app in HTML, CSS and JavaScript, then was asked to create it again in Bootstrap too. I\'ve done it all fine, but I had toggle buttons in the web app t

10条回答
  •  情深已故
    2021-01-30 01:19

    Bootstrap 3 has options to create toggle buttons based on checkboxes or radio buttons: http://getbootstrap.com/javascript/#buttons

    Checkboxes

    Radio buttons

    For these to work you must initialize .btns with Bootstrap's Javascript:

    $('.btn').button();
    

提交回复
热议问题