jquery chekbox selected

Posted by Dejan.S on Stack Overflow See other posts from Stack Overflow or by Dejan.S
Published on 2010-04-15T06:54:25Z Indexed on 2010/04/15 7:03 UTC
Read the original article Hit count: 307

Filed under:

Hi I'm having some problems with jquery checkbox selected. I want to do a task when the checkbox is selected. my code for this is

$(document).ready(function() {
        if ($('#chxGetText').is(':checked')) {
            alert("OK");
        }
    });

<input id="chxGetText" type="checkbox" />

But nothing happen when I check the checkbox. Any ideas?

© Stack Overflow or respective owner

Related posts about jQuery