My dilemma involves a series of divs with different manufacturer IDs listed as follows:
manufacturer[1], manufacturer[2], manufacturer[3], ... etc ...
In attempting to create a JavaScript for loop to hide each div, I discovered that it was not achievable.
I realized that in this context, closing the divs actually meant hiding them (display:none).
So, now I require assistance in composing a simple jQuery code snippet to accomplish this task:
function hideAllManufacturers(manufacturersID)
{
var manufacturer = [1,2,3,];
$.each(manufacturer, function(index, val) {
$('.manufacturer['+val+']').hide();
});
}
Although my code implementation works, the subsequent code is not being displayed. This leads me to believe there may be an issue with what I have written.
I am curious if having a comma at the end is causing any problems?
Your guidance is much appreciated!