在线运行JavaScript

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>在线运行JavaScript - JavaScript乐园</title>

<meta name="keywords" content="在线运行javascript" />

<script language="JavaScript" type="text/JavaScript">

<!--

    function runJs(s) {

        var codeArea = document.getElementById(s);

        var code = codeArea.value;

        if (code!=""){

            var newwin=window.open('','','');

            newwin.opener = null;

            newwin.document.write(code);

            newwin.document.close();

        }

    }

//-->

</script>

</head>



<body>

<textarea cols="100" rows="25" id="c"></textarea>

<br><input onclick="runJs('c')" type="button" value="运行代码" /> <input onclick="document.getElementById('c').value='';" type="button" value="清空代码" />

</body>

</html>

 

阅读更多
换一批

没有更多推荐了,返回首页