I\'m performing a small text with JavaScript with the getElementsByClassName() and I am getting some unwanted results. I would like the script to change each CS
getElementsByClassName()
This error is because you need to do
blockSet[0].className = 'block-selected'
You don't to write blockSet[1] , blockSet[2] ...
You can do:
for (var s=0;s