<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<script>
document.write("I Like You!");//输入内容:document.write();
//alert消息对话框。
function rec(){
var mychar="I Like You!";
alert(mychar);
}
//确认、取消: confirm消息对话框。
var message=confirm("Do You Like it?");
if(message==true){
document.write("GOOD!");
}else{
document.write("记得学习哦!");
}
//提问判断:prompt消息对话框。
var myname=prompt("请输入您的姓名:");
if(myname!=null){
alert("您好:"+myname);
}else{
alert("您好无名氏。")
}
//打开新窗口:window.open。
window.open([URL], [窗口名称], [参数字符串]);
//关闭窗口:window.close。
<窗口对象>.close();
//innerHTML 属性用于获取或替换 HTML 元素的内容。
//显示和隐藏:display属性
function hidetext(){
var mychar = document.getElementById("con");
mychar.style.display="none";
}
function showtext(){
var mychar = document.getElementById("con");
mychar.style.display="block";
}
</script>
</body>
</html>