如何设置才能在帖子中使用iframe代码
展开全部
<html>
<body>
<input type=button value="改变" onclick="changeIframeHTML()"/>
<iframe id="fram_1"></iframe>
</body>
<script>
document.getElementById('fram_1').contentWindow.document.write('<div id="cc">哈哈哈,这太TMD简单了</div>');
function changeIframeHTML(){
document.getElementById('fram_1').contentWindow.document.getElementById('cc').innerHTML = '改变了,用JQ更简单';
}
</script>
<body>
<input type=button value="改变" onclick="changeIframeHTML()"/>
<iframe id="fram_1"></iframe>
</body>
<script>
document.getElementById('fram_1').contentWindow.document.write('<div id="cc">哈哈哈,这太TMD简单了</div>');
function changeIframeHTML(){
document.getElementById('fram_1').contentWindow.document.getElementById('cc').innerHTML = '改变了,用JQ更简单';
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询