I have a string in Javascript and i want to add something to it when a checkbox is checked and the submit button is activated.
What i have is this:
var strDimensions = ["Sex","Age"];
$("input[id='Class']:checked").each(function() {
strDimensions += "Class";
}
);
var chart = d3.parsets().dimensions(strDimensions);
The only thing thats not working is adding up Class to the string.
i want strDimensions to be this when the checkbox is checked:
strDimensions = ["Sex","Age","Class"];
Don’t you mean
Array.push?