父页面通过window.open打开的子页面
father.html
<input type="" name="main" id="mmm" value="123" /><script type="text/javascript">
$('#Btn').on('click',function(){ window.open('son.html');
});</script>son.html
<script type="text/javascript">
alert(window.opener.document.getElementById('mmm').value); </script>控制台
Uncaught TypeError: Cannot read property 'value' of null at son.html:21
陪伴而非守候
随时随地看视频慕课网APP
相关分类