I have global variables:
units = 0;
majorUnits = 0;
supportUnits = 0;
requiredUnits = 0;
electiveUnits = 0;
electiveUnitsStop = 0;
pending = 0;
percent = 0;
supportPercent = 0;
requiredPercent = 0;
electivePercent = 0;
I use this variables on function:
$("tr").click(function() {
$(this).toggleClass("taken");
if ( $(this).hasClass('taken') )
{ .....
Then I have a second function in which I set variables back to zero:
$( "#clear-button" ).click(function() {
units = 0;
majorUnits = 0;
supportUnits = 0;
requiredUnits = 0;
electiveUnits = 0;
electiveUnitsStop = 0;
pending = 0;
percent = 0;
supportPercent = 0;
requiredPercent = 0;
electivePercent = 0;
// $( "tr" ).click();
//$("tr").find('taken').removeClass('taken');
//$("table").closest('tr').find('.taken').removeClass('taken');
//$("tr").removeClass();
//taken.allInstances = [];
});
As seen above in commented code I'm trying to remove all occurrences of
class taken
that might or might not be present in the rows of my html table.
How could I accomplish this ?!?!
I would really appreciate any help.