Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2012
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post Why is it not Un-checking check boxes?

    Hey, I don't know what I am doing wrong but following code doesn't clear checkboxes:

    Code:
    $("document").ready(function () {
        $('input:checkbox').prop("checked");
    });
    Thanks in Advance

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,386
    Thanks
    11
    Thanked 565 Times in 558 Posts
    You need to understand the difference between setters and getters. The getter for .prop() has one parameter, whereas the setter has two. So you used the getter where you wanted to use the setter instead.
    Code:
    $("document").ready(function () {
        $('input:checkbox').prop("checked", false);
    });

  • Users who have thanked devnull69 for this post:

    Vrutin (01-03-2013)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •