Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 6
    Starting jquery 1.6 there have been significant changes the way attributes and properties are dealt with. For your case following should work: if($('#isAgeSelected').prop("checked")) { $("#txtAge").show(); } else { $("#txtAge").hide(); } The condition in if statement will simply return true or false depending upon the checked/unchecked state of the check box. For more details refer to attributes vs. properties section on this link.
    – RBT
    Commented Feb 12, 2016 at 18:44
  • 3
    Does this answer your question? How can I check if a checkbox is checked?
    – Liam
    Commented May 13, 2022 at 13:51