1//<div id="demo-id"></div>
2var elem1 = document.getElementById("demo-id");
3//<div class="demo-class"></div>
4var elem2 = document.getElementsByClassName("demo-class");
5//<div name="demo-name"></div>
6var elem3 = document.getElementsByName("demo-name");
7//<p>Some text</p>
8var elem4 = document.getElementsByTagName("p");
9
10//<div id="demo-id"></div>
11var elem1 = document.querySelector("#demo-id");
12//<div class="demo-class"></div>
13var elem2 = document.querySelectorAll(".demo-class");
14//<div name="demo-name"></div>
15var elem3 = document.querySelectorAll('[name="demo-name"]');
16//<p>Some text</p>
17var elem4 = document.querySelectorAll("p");