CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   Why is it not Un-checking check boxes? (http://www.codingforums.com/showthread.php?t=285176)

Vrutin 01-03-2013 01:07 AM

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

devnull69 01-03-2013 10:42 AM

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);
});



All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.