Ahmadz Issa
Ahmadz Issa

Reputation: 765

How to checked if Bootstrap toggle checked or not in jQuery

I'm trying to use Bootstrap Toggle, but I don't know how to check when a user check it on or off in order to send it using ajax.

how can I do that ?

<div class="checkbox">
    <label data-label-id="<?= $data->id; ?>" id="message_status">
        <input id="check_toogle" type="checkbox" data-toggle="toggle">
    </label>
    <div class="delete_message">
        &#10060;
    </div>
</div>

http://www.bootstraptoggle.com/

Upvotes: 1

Views: 6027

Answers (1)

Igor Dymov
Igor Dymov

Reputation: 16460

I guess

$('#bsfdsf').is(':checked')

is a way to go. This should return true if checkbox is checked and false otherwise.

Upvotes: 5

Related Questions