window.open 传值为空?

父页面通过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


陪伴而非守候
浏览 786回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript