Unit 7.1. Embedding JavaScript in HTML

A First Example

JavaScript can be embedded within HTML. The <SCRIPT> tag allows you to do this.

FOR EXAMPLE

<HTML> 
<HEAD> 
<SCRIPT language="JavaScript">
							<!--Begin hiding content from old browsers.
							alert("This is an Alert!");
							document.write("I'm being written by JavaScript!");
							//End hiding here-->
							</SCRIPT> 
</HEAD> 
<BODY> 
<H2>A First JavaScript Script</H2> 
<P>This is text within paragraph tags.</P> 
</BODY> 
</HTML> 

The example above is a very simple JavaScript script embedded within an HTML page. It does two things:

  1. It creates a pop-up message, called an alert, with the text “This is an Alert!” (Figure ...

Get Oracle® Web Application Programming for PL/SQL® Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.