Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-03-2013, 01:07 AM   PM User | #1
Vrutin
New Coder

 
Join Date: Dec 2012
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Vrutin is an unknown quantity at this point
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
Vrutin is offline   Reply With Quote
Old 01-03-2013, 10:42 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
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);
});
devnull69 is offline   Reply With Quote
Users who have thanked devnull69 for this post:
Vrutin (01-03-2013)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:52 AM.


Advertisement
Log in to turn off these ads.