I have a variable named countTicked that is storing an integer of how many relatedBoxes there are on the page.
I need an if statement that does something when the value of countTicked is greater than 1.
if (!$(clickedCheckBox).is(':checked'))
{
//do something
}
else
{
var selectedDots = $(currentMap).find('div.' + checkBoxID);
var relatedCheckBoxes = $(selectedDots).attr('class');
var countTicked = $(relatedCheckBoxes).filter(':checked');
if (countTicked > 1)
{
//do one thing
}
else
{
//do something else
}
}
I have implemented the changes you guys have provided. But my second IF statement still doesnt work. What am I still doing wrong?
Why do use use the $ sign? what is relatedBoxes?
Update: you have to use the length to get the number of elements.