Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jquery Check AND Uncheck Checkbox #46

Closed
seyedmohammadhosseini opened this issue Jun 21, 2015 · 2 comments
Closed

Jquery Check AND Uncheck Checkbox #46

seyedmohammadhosseini opened this issue Jun 21, 2015 · 2 comments

Comments

@seyedmohammadhosseini
Copy link

Hi Guys
First, Thank You
Have a problem
how check and uncheck with jquery ?
with jquery, when uncheck checkboxs , yet checkboxs are selected

MyCode

        if($(this).is(':checked')){
            $("#pages-result input[type='checkbox']").each(function(){
                $(this).attr("checked","checked");
            });
        }else{
            $("#pages-result input[type='checkbox']").each(function(){
                $(this).removeAttr("checked");
            });
        }
@PimHaarsma
Copy link

Hi! This will work:
$(this).prop('checked', true);
$(this).prop('checked', false);

@seyedmohammadhosseini
Copy link
Author

@PimHaarsma Thank You So Much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants