how to get element by class into javascript array code example Example: javascript document object model getElementsByClassName document.getElementsByClassName('test')