document.getElementById("zx");
Get the html element object by ID. The ID number should be unique in the html document. What is returned is the only element object. And all browsers are compatible.
document.getElementsByTagName("span")[0];
Find html objects through tags. Since html tags may be repeated many times in a page, the current page returns an array. An object that can position elements based on where the label appears. All browsers are compatible.
document.getElementsByName("hh")[0];
Locate the html object through the name attribute, but not all tags have the name attribute, but we can artificially add the name attribute, so that it can also be located. Since there may be multiple name attributes, they are not unique. So this method also returns an array. Similarly, we can also position the name according to the position of the name in the html. The IE series is not compatible and is not recommended.
innerHTML: This method is to get the specific html code of the html element
document.getElementById("zx").innerHTML;
You can also update the html code of the element:
document.getElementById("zx").innerHTML="Let’s go on a date~";