get element by class attribute code example Example: javascript get element by class var elementsArray = document.getElementsByClassName("someclassname");