zoukankan      html  css  js  c++  java
  • 运行代码

    View Code
    window.onload=function()
    {
        var txt=document.getElementById('txt');
        var oBtn=document.getElementById('btn');
        
        oBtn.onclick=function()
        {
            var oWindow=window.open('about:blank','_blank');
            oWindow.document.write(txt.value);
            txt.value='';
        };
    };
     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     5 <title>无标题文档</title>
     6 <script>
     7 window.onload=function()
     8 {
     9     var txt=document.getElementById('txt');
    10     var oBtn=document.getElementById('btn');
    11     
    12     oBtn.onclick=function()
    13     {
    14         var oWindow=window.open('about:blank','_blank');
    15         oWindow.document.write(txt.value);
    16         txt.value='';
    17     };
    18 };
    19 </script>
    20 </head>
    21 
    22 <body>
    23 <textarea id="txt" rows="10" cols="40"></textarea><br />
    24 <input type="button" value="运行代码" id="btn" />
    25 </body>
    26 </html>
  • 相关阅读:
    lsmod命令详解
    init命令详解
    runlevel 命令详解
    nohup命令详解
    nice和renice命令详解
    pstree命令详解
    ps命令详解
    crontab命令详解
    pkill命令详解
    killall命令详解
  • 原文地址:https://www.cnblogs.com/52css/p/3017095.html
Copyright © 2011-2022 走看看