<! DOCTYPE HTML > < HTML > < head > < Meta charset = "UTF-. 8" > < title > JavaScript Usage </ title > </ head > < body > < H3 > JavaScript the Usage (the Usage: Usage) </ H3 > <-! 1.javascript must be placed in the <script> and between </ script>; -> <-! 2.javascript standard script is placed in the <head> the </ head> tags or <body > the </ body> tag at the bottom, to improve readability; -> <!- 3. Also note that among the practical application of the priority of execution of the script; -> <-!& lt; escaped as <& gt; escapes> -> < P > for example writing HTML output stream: </ P > < Script > document.write ( " <style = P 'Color: Red;'> this is a red text </ P>! " ); </ Script > <-! summary: document.write only be used in the HTML output stream if it is used after the code has been loaded (as in function) It will cover the loaded content, as follows. ->
< P > ----------------------- parting line ----------------------- </ P > < P style = "Cursor: pointer;" the onclick = 'text () 'onclick = 'text ()' is executed mouse click text () -> <-! Cursor: pointer; mouse over the text, the cursor changes to a hand; properties may not be added, where just for simulation; -> web page has loaded, click on me again, will perform the text () function coverage; </ the p- > < Script > function text () { / * text () function name * / document.write ( " <the p-> I cover ! content of the page has been loaded </ P> " ); } </ Script > </ body > </ HTML >
JavaScript003, usage
Guess you like
Origin www.cnblogs.com/zhou0910/p/12082630.html
Recommended
Ranking