Not much nonsense, directly to the people to work, the specific details as follows:
1, alert ("Content to be exported");
-> a dialog box in the browser and then displays what you want to output
->alert converts the content to be output first to a string and then to the output
2, document.write ("content to be exported");
-> directly in the page to show the content of the output
3, Console.log ("content to be exported");
-> Output in console
4, Value-> to text box (form Element) assignment content
-> get the contents of a text box (form Element)
document.getElementById ("Search"). Value = "What to add to #search this text box";
5, Innerhtml/innertext-> to the form element in addition to the label assignment content
document.getElementById ("Div1"). InnerHTML = "Come on, let's Go!"
document.getElementById ("Div1"). innertext = "Come on, let's Go!"
The difference between->innerhtml and innertext
1 innerHTML when the value of the assignment, if you encounter a valid HTML tag will treat it as a real label processing, the label can play their role;
InnerText whether or not the label as text to assign value, then see is the text, the label does not play its role;
(innerHTML can recognize HTML tags when assigned, and innertext cannot recognize them)
2 in some Firefox browsers, InnerText is not supported, and innerHTML is supported by all browsers