get all tags html elements javascript code example
Example 1: document get element by tag
var list = document.getElementsByTagName("UL")[0];
list.getElementsByTagName("LI")[0].innerHTML = "Milk";
Example 2: dom get all tags
const allElements = document.getElementsByTagName("*");
const allTagNames = new Set([].map.call(allElements, el => el.nodeName.toLowerCase()));