hanxuming

——————————————————————————

<script type="text/javascript">        
            function doPrint(){
                window.open(\'print.html\');
            }
        </script>

————————————————————————

<body style="text-align:center">
        <form>
            <label>姓名:</label>
            <input name="the_name" type="text"/>
            <br>
            <label>年龄:</label>
            <input name="age" type="text"/>
            <br>
            <label>性别:</label>
            <input name="gender" type="text"/>
            <br>
            <input type="button" onclick="doPrint();" value="打印"/>
        </form>
    </body>

————————————————————————

print.html :

<script type="text/javascript">        
            function init(){
                var w = window.opener;
                var f = w.document.forms[0];
                var str = \'\';
                str += \'姓名:\' + f[\'the_name\'].value;
                str += \',年龄: \' + f[\'age\'].value;
                str += \',性别: \' + f[\'gender\'].value;
                document.body.innerHTML = str;
            }
</script>   

——————————————————————————

分类:

技术点:

相关文章:

  • 2021-10-19
  • 2021-12-12
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
猜你喜欢
  • 2021-12-22
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案