Copy the codeThe code is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Event Handling</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--
<script language="text/javascript" src="">The external call tag of this js cannot end on its own</script>
<link rel="stylesheet" type="text/css" href="./">
-->
<script type="text/javascript">
function clickD(obj){
alert();
}
function mouseD(obj){
= "#f00";
//When using code to set styles, if the css is represented by -, it must be marked with camel -> fontSize
= "16px";
}
function outD(obj){
= "#000";
= "18px";
}
//Usage
with(document){
write("dddd<br/>");
}
("aaaa<br/>");
("bbbb<br/>");
("cccc<br/>");
</script>
</head>
<body>
<div onclick="clickD(this)" style="cursor:pointer;">Click to try</div>
<div onmouseover="mouseD(this)" onmouseout="outD(this)">Try moving the mouse</div>
</body>
</html>
2. Example of browser object: "It involves passing values between two browser pages"
Copy the codeThe code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http:///TR/html4/">
<html xmlns="http:///1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js01_hello</title>
<meta name="author" content="Administrator" />
<script type="text/javascript">
// setTimeout("endWelcome()",5000);
// function endWelcome() {
// ("welcome"). = "none";
// }
</script>
</head>
<body>
<div >Welcome to our website</div>
<a href="#" onclick="('','aaa','width=300,height=300,resizable=0')">test02</a>
<a href="#" onclick="('','aaa','width=400,height=400,resizable=0')">test03</a>
<br/>
<a href="#" onclick="('','aaa','width=600,height=300')">Enter your blessing</a>
<a href="#" onclick="('','aaa','width=600,height=300')">Select gender</a>
<div ></div>
</body>
</html>
Copy the codeThe code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http:///TR/html4/">
<html xmlns="http:///1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js01_hello</title>
<meta name="author" content="Administrator" />
<script type="text/javascript">
function bless() {
//Get the entered blessings
var mb = ("mb").value;
//Get the parent class window
var p = ;
//Get the div with id bless in the parent class window
var pd = ("bless");
//Set the value of pd
= mb;
//Close the current window
();
}
</script>
</head>
<body>
Enter a blessing:<input type="text" size="40" /><input type="button" onclick="bless()" value="input" />
</body>
</html>