Чтобы посмотреть как работает код, кликните на имя файла
Исходный код:
файл Alert.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Alert</TITLE></HEAD>
<BODY onload="javascript:alert('Hello!');" onunload="alert('Good-bye!')">
Text
</BODY>
</HTML>
файл browser_background.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Background</TITLE></HEAD>
<BODY>
<FORM name="frm">
<INPUT type="button" value=" red "
onclick="document.bgColor='red'">
<INPUT type="button" value=" blue "
onclick="document.bgColor='blue'">
<INPUT type="button" value=" green "
onclick="document.bgColor='green'">
<INPUT type="button" value=" white "
onclick="document.bgColor='white'">
</FORM>
</BODY>
</HTML>
Файл daycount1.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Month Day Number</TITLE></HEAD>
<BODY>
<SCRIPT type="text/javascript" language="JavaScript">
<!--
var monthnumber = prompt('Input month number (0...11)','');
monthnumber = parseInt(monthnumber, 10);
if(monthnumber==1)
alert('28 or 29');
else
if(((monthnumber%2==0)&&(monthnumber<=6)
||(monthnumber%2==1)&&(monthnumber>6)))
alert('31');
else
alert('30');
//-->
</SCRIPT>
</BODY>
</HTML>
Файл daycount2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Month Day Number</TITLE></HEAD>
<BODY>
<SCRIPT type="text/javascript" language="JavaScript">
<!--
var monthnumber = prompt('Input month number (0...11)','');
if((monthnumber<0)||(monthnumber>11))
alert('Error!!!');
else
if(monthnumber==1)
alert('28 or 29');
else
if(((monthnumber%2==0)&&(monthnumber<=6)
||(monthnumber%2==1)&&(monthnumber>6)))
alert('31');
else
alert('30');
//-->
</SCRIPT>
</BODY>
</HTML>
Файл graphic_button.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Graphic button</TITLE>
</HEAD>
<BODY>
<A href="second.html"
onmouseover="document.mainimage.src='image2.gif'"
onmouseout="document.mainimage.src='image1.gif'">
<IMG name="mainimage" src="image1.gif"
border="0" width="443" height="338">
</A>
</BODY>
</HTML>
Файл mathematics1.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Mathematics</TITLE></HEAD>
<BODY>
<SCRIPT type="text/javascript" language="JavaScript">
<!--
var x = prompt('Input x','');
x = parseInt(x, 10);
x += 88;
alert( x );
//-->
</SCRIPT>
</BODY>
</HTML>
Файл mathematics2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>Mathematics</TITLE></HEAD>
<BODY>
<SCRIPT type="text/javascript" language="JavaScript">
<!--
var x = prompt('Input x','');
var y = Math.cos(x);
alert( 'y = ' + y );
//-->
</SCRIPT>
</BODY>
</HTML>