Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checkbox in Semantic UI

I'm trying to do checkbox in Semantic UI, but it doesn't work and I can't figure out what I'm doing wrong. I'm including jquery, semantic.min.js, checkbox.js and semantic.min.css, then I add this code:

$('.ui.checkbox')
    .checkbox()
;

There is console output, but image of checkbox doesn't change.

like image 465
user2209284 Avatar asked Dec 19 '22 20:12

user2209284


2 Answers

I've solved this problem to write jQuery's code like this:

$(document).ready(
        function () {
            $('.ui.checkbox')
                    .checkbox()
                    ;
        });
like image 51
Maksim Tikhonov Avatar answered May 17 '23 08:05

Maksim Tikhonov


Did you wrap it on proper Div tags?

<div class="ui checkbox">
  <input type="checkbox" name="fun">
  <label>I enjoy having fun</label>
</div>
like image 44
Yu Yu Avatar answered May 17 '23 09:05

Yu Yu