find element in javascript
//<div id="demo-id"></div>
var ele1 = document.getElementById("demo-id");
//<div class="demo-class"></div>
var ele2 = document.getElementsByClassName("demo-class");
//<div name="demo-name"></div>
var ele3 = document.getElementsByName("demo-name");
//<p>Some text</p>
var ele4 = document.getElementsByTagName("p");
//<div id="demo-id"></div>
var ele1 = document.querySelector("#demo-id");
//<div class="demo-class"></div>
var ele2 = document.querySelectorAll(".demo-class");
//<div name="demo-name"></div>
var ele3 = document.querySelectorAll('[name="demo-name"]');
//<p>Some text</p>
var ele4 = document.querySelectorAll("p");