O'Reilly logo

Oracle® Web Application Programming for PL/SQL® Developers by Benjamin Rosenzweig, Solomon Morse, Melanie Caffrey, Susan Boardman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required