如果是的话~ 这就知道为什么错了。
input 标签叫表单元素,所谓表单元素就是说是与 form标签一起使用的,
并且是<form>标签的子元素。
如果你这里结构是这样的:
<body>
<form action="#" id="form1">
<input type="button" id="button1"/>
</form>
</body>
要访问就得document.form1.button1
iframe 外面放一个div层,在js中动态改变div的style 属性:window.parent.$("#id").attr("style","filter:alpha(opacity=10)")
<body style="background-image: url(http://i2.sinaimg.cn/home/07index/sinahome_ws_009.gif)"><script type="text/javascript">
function selectbg(img){
//alert(window.document.body.style.backgroundImage)
window.document.body.style.backgroundImage = "url("+img+")"
}
</script>
<a href="javascript:selectbg('http://img.baidu.com/img/logo-zhidao.gif')">baidu背景</a>
<a href="javascript:selectbg('http://www.google.cn/intl/zh-CN/images/logo_cn.gif')">google背景</a>
</body>