<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<style>
#buttonA {
display: block;
width: 120px;
height: 35px;
background-color: gray;
line-height: 35px;
text-align: center;
}
#buttonA:hover{
color:white;
background-color: black;
cursor:pointer;
}
</style>
<!-- <script type="text/javascript" src="js/jquery1.11.3.js"></script>-->
</head>
<body>
<a id="buttonA" >Click</a>
<iframe id="testFrame" src="
http://www.baidu.com" width="100%" height="500"></iframe><script>
/*$(document).ready(function(){
$("#buttonA").click(function(){
$("#testFrame").attr("src","
http://www.sina.com.cn");
});
});*/
window.onload=function(){
var button=document.getElementById("buttonA");
var iframe=document.getElementById("testFrame");
button.onclick=function(){
console.log(iframe);
iframe.src="
http://www.sina.com.cn"; };
};
</script>
</body>
</html>