how to get class value in document.getelementbyid code example Example: getelementbyclass var selector = document.getElementsByClassName('class-name');