Below is a JavaScript/jQuery function that I have:
function hideShowHiddens(action){
$('.hidden_col').each(function(){
if(action == 'show'){
this.removeClass("hidden");
}else{
this.addClass("hidden");
}
});
}
This function is supposed to search a JSP for every element with the CSS class '.hidden_col'. Depending on the parameter passed, it will add or remove another CSS class called '.hidden', which actually hides the elements.
Using this method should help me save around 400 lines of slow JavaScript functions, given the amount of data I am working with. However, when running it, I encounter an error from the browser indicating that this method is not supported. Can anyone explain why it's not working or provide a solution?