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