17th Jul2012
Author: Gyro

Firefox does not support getElementsByClassName

This is just a friendly reminder that Firefox does not support getElementsByClassName…

but not to worry, unless you are doing some really weird programming, we can use getElements to accomplish almost the same thing.


So instead of using getElementsByClassName:

$(document.body).getElementsByClassName(‘someclass').addClass(‘highlight');

Use getElements

$(document.body).getElements(‘TheElements.someclass').addClass(‘highlight');

TheElements is a placeholder for any html element type, like div,input, p, etc..

657

Keep Me Going
Your Name / Website:
Did you like my post? Buy me a Bitcoffee! 14JX52Li7zTKbyQv2omw4tvu6Bi1KzfHNW



Leave a Reply

Your email address will not be published. Required fields are marked *

What is 9 + 13 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)