1、document
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=GB2312"/>
<title>use document.write</title>
<!-- script code -->
<script type="text/javascript">
document.write("hello");
document.write("<br><b>Ouput html </b>");
</script>
</head>
<body style="overflow:auto;">
<input type="buttom" value="clip me" onclick="document.write('After load page,use document.write will clear original content')"/>
</body>
</html>
2、hello_pro
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=GB2312"/>
<title>improve hello</title>
</head>
<body style="overflow:auto;padding:0px;margin:0px;">
<div style="font-size:14px;font-weight:bold;color:white;font-family:Arial,宋体;background-color:#6090DA;padding:4px 10px">
hello
<script>
if(confirm("need time?"))
{
dt = new Date();
document.write(",current time is ");
document.write(dt.toLocaleTimeString());
}
</script>
</div>
</body>
</html>
3、add
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=GB2312"/>
<title>Input two number and calculate the add result</title>
</head>
<body style="overflow:auto;padding:0px;margin:0Px;">
<div style="font-size:14px;font-weight:bold;color:white;font-family:Arial,宋体;background-color:#6090DA;padding:4px 10px;">
<script>
intA=prompt("please input first number", "0");
intB=prompt("please input second number", "0");
document.write("first number is " + intA);
document.write("<br>second number is " + intB);
document.write("<br>sum is " + (parseInt(intA) + parseInt(intB)));
</script>
</div>
</body>
</html>
4、string
<html>
<head>
<meta http-equiv="conten-type" content="text/html;charset=GB2312"/>
<title>common use of string</title>
</head>
<body style="overflow:auto;padding:0Px;margin:0px;">
<div style="font-size:14px;font-weight:bold;color:white;font-famile:Arial,宋体;background-color:#6090DA;padding:4px 10px;">
<script>
document.write("big effect".big());
document.write("<br>bold effect".bold());
document.write("<br>fontsize=5 effect".fontsize("5"));
document.write("<br>A Unicode is " + "A".charCodeAt(0));
document.write("<br>The number which unicode value is 70 is " + String.fromCharCode(70));
document.write("<br>Test toLowerCase".toLowerCase());
document.write("<br>Test toUpperCase".toUpperCase());
</script>
</div>
</body>
</html>