javascript select all div elements code example
Example 1: javascript select all elements
// example:
document.querySelectorAll('.message');
// syntax:
// document.querySelectorAll('.<class-name>')
Example 2: js select element inside of div
var targetDiv = document.getElementById("foo").getElementsByClassName("bar")[0];
Example 3: select all elements javascript
var elements = document.getElementsByTagName("*");