How to toggle content in Semantic UI buttons?

前端 未结 4 1331
春和景丽
春和景丽 2021-02-05 06:00

The documentation says a button can be formatted to toggle on or off, but the example given is merely

Vote &
4条回答
  •  后悔当初
    2021-02-05 06:34

    The easiest way to get the toggle buttons working without any options etc is the following:

    $('.ui.button.toggle').state();
    

    This should toggle between the default grey and green colors on click. See the other answers for more complicated behaviour. Make sure the DOM etc is loaded first as with other semantic UI initializers.

提交回复
热议问题