A. Overview
1. Output tool:
document.write()---can be html
alert()---string
prompt(text,defaultText)
text---optional. Plain text (not HTML-formatted text) to be displayed in the dialog box.
defaultText---optional. Default input text.
Placement of 2.js
a. Can be placed anywhere in HTML
b. But they are a whole and influence each other
c. At the location of hyperlinks and redirects
<a href="javascript:alert();"></a> <form action="javascript:alert();"></form> <div onclick="alert()"></div> ********IE下可行,不推荐使用******** <div id="one"></div> <script for="one" event="onclick"> alert(111); </script>
d. Call external javascript files
1. No code can appear in the calling js tag
2. The