码迷,mamicode.com
首页 > 编程语言 > 详细

javascript定义框架页背景色代码

时间:2015-04-01 20:10:21      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:背景色 javascript

javascript定义框架页背景色代码

<!DOCTYPE html>
<html>
<head>
<script>
function changeStyle()
{
var x=document.getElementById("myframe");
var y=(x.contentWindow || x.contentDocument);
if (y.document)y=y.document;
y.body.style.backgroundColor="#0000ff";
}
</script>
</head>
<body>
<iframe id="myframe" src="demo_iframe.htm">
<p>Your browser does not support iframes.</p>
</iframe>
<br><br>
<input type="button" onclick="changeStyle()" 
value="Change background color">
</body>
</html>


本文出自 “赚的多不多” 博客,请务必保留此出处http://10068168.blog.51cto.com/10058168/1627405

javascript定义框架页背景色代码

标签:背景色 javascript

原文地址:http://10068168.blog.51cto.com/10058168/1627405

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!