Professional Documents
Culture Documents
Java Script.: Javascript: Reacting To Events
Java Script.: Javascript: Reacting To Events
You can only use document.write in the HTML output. If you use it after the document has loaded, the whole document will be overwritten.
The onclic' event is only one of the many HTML events you will learn about in this tutorial.
%e#</button>
(sin" JavaScript to manipulate the content of HTML elements is a very powerful functionality.
-a.a )nput
Scripts can be in the +body, or in the +head, section of HTML, and-or in both.
It is a common practice to put functions in the +head, section, or at the bottom of the pa"e. This way they are all in one place and do not interfere with pa"e content.
<script src="my/cript.5s"></script>
To use an e.ternal script, point to the ./s file in the 0src0 attribute of the +script, ta"