document.body.innerHTML = ""

解决方案 »

  1.   

    阿弥陀佛
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>dhtml.document.clear.html</title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <h3>清除全部文档内容!注:IE6sp1, FF2 测试可用!</h3>
        <pre>clear MethodNot currently supported. To clear all elements in the current document, use document.write(""), followed by document.close.[/</pre>
        <input type="text" id="" />
        <select id="">
            <option value="" selected="selected"></option>
            <option value=""></option>
        </select>
        <input type="button" id="btnClear" value="Clear" />    <script type="text/javascript">
        <!--document.clear = function()
    {
        document.write("");
        document.close();
    };document.getElementById("btnClear").onclick = function()
    {
        document.clear();
    };
        //-->
        </script>
    </body>
    </html>
    送你三本手册!DHTML参考手册
    http://download.csdn.net/source/308913样式表中文手册
    http://download.csdn.net/source/304124JScript语言参考
    http://download.csdn.net/source/308916