January 2001
Beginner
312 pages
6h 4m
English
Inline JavaScript is JavaScript that has been typed directly into the HTML tags of a Web page. This method is again simple, but what it gains in simplicity it lacks in power. Inline JavaScript is best suited to simple examples, and any complex JavaScript is best left to one of the other methods.
Here is an example of an inline JavaScript that brings up a prompt box:
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!
// Cloaking device off -->
</script>
</head>
<body>
<p onclick="prompt('How many do you want', 'Enter quantity');"> Click here to specify
quantity</p> </body> </html> ...Read now
Unlock full access