JS如何获取iframe内html的body值

时间:2023-03-09 20:03:44
JS如何获取iframe内html的body值

default页面:

<html>
<head>
<script type="text/javascript">
window.onload=function()
{
var img = document.frames["IFeditValue"].document.getElementById('editValue');
alert(img.innerHTML);
}
</script>
</head>
<body>
<iframe id="IFeditValue" src="blank.html" scrolling="auto" height="800" width="1000"></iframe>
</body>
</html>