So, I have this next variable that contains my checked checkboxes:
var checked = $('input[name="article[]"]:checked');
But how can I know if there is 1 checked, 2 or even none? Because console.log(checked.length) always returns 1.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I know it’s a stupid mistake but for everybody to know, the problem was that I was doing this:
instead of this
btw, I don’t know why the “hate” on the other answers (for those who down voted), the answers given… work (I’ve tested 2 of them)