The page output methods are: 1. Use the "window.alert('content');" statement to pop up a warning box; 2. Use the "element object.innerHTML="content"" statement to insert new elements into the specified element. Content; 3. Use the "docuemnt.write("content")" statement to write the new content into the HTML document.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
html5 page output method
Usewindow.alert()
Pop up warning box
Use thedocument.write()
method to write the content into the html document
Use the element object. innerHtml="value to be written";
Write to HTML element
1. Use window.alert()
2. Manipulate HTML elements
If you need JavaScript to access an HTML element, you can use the document.getElementById(id) method
Please use the id attribute to identify HTML element, and innerHTml to get or insert element content:
我的第一个段落
Note: If document.write() is executed after the document has been loaded, it will cover the entire HTML page