日期:2014-05-16 浏览次数:20389 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">
#divLink {
border: solid 1px red;
width: 200px;
height: 100px;
float: left;
}
#divShow {
border: solid 1px blue;
width: 800px;
height: 600px;
}
</style>
</head>
<body>
<div id="divLink">
<a href="http://www.g.cn/">google</a><br />
<a href="http://www.baidu.com/">baidu</a>
</div>
<div id="divShow" class="">
<iframe id="ifmShow" width="800" height="600"></iframe>
</div>
</body>
<script type="text/javascript">
<!--
var $ = document.getElementById;
var clink = $("divLink").getElementsByTagName("a");
for (var i=0; i<clink.length; i++)
{
clink[i].onclick = function() {
$("ifmShow").src = this.href;
event.returnValue = false;
};
}
//-->
</script>
</html>
<HTML>
<HEAD>
<style type="text/css">
div {
height:100px;width:150px;border:solid 1px #09c;
}
</style>
<script>
var add=function() {
document.getElementById("test").innerHTML="添加的内容";
}
</script>
</HEAD>
<BODY>
<div id = "test"> </div> <div id = "test2" ><a href="javascript:" onclick="add()">点击链接</a> </div>
</BODY>
</HTML>