<input type="button" value="submit"> 这样试试
可能是IE4不支持 <  /> 这种关闭对应吧

解决方案 »

  1.   

    试过了,不是这个问题。<html>
    <head>
    <title>getExpression(), setExpression(), and recalc() Methods</title>
    <style type="text/css">
    th {text-align:right}
    span {vertical-align:bottom}
    </style>
    <script type="text/javascript">
    var now = new Date();
    var shortWidth = 5;
    var multiple = 2.5;
    function init() {
    with (document.all) {
    hoursBlock.style.setExpression("width","now.getHours() * shortWidth * multiple","jscript");
    hoursLabel.setExpression("innerHTML","now.getHours()","jscript");
    minutesBlock.style.setExpression("width","now.getMinutes() * shortWidth","jscript");
    minutesLabel.setExpression("innerHTML","now.getMinutes()", "jscript");
    secondsBlock.style.setExpression("width","now.getSeconds() * shortWidth","jscript");
    secondsLabel.setExpression("innerHTML","now.getSeconds()", "jscript");
    }
    updateClock();
    }
    function updateClock() {
    now = new Date();
    document.recalc();
    setTimeout("updateClock()",1000);
    }
    function showExpr() {
    alert("Expression for the \'Hours\' innerHTML property is:\r\n" + document.getElementById("hoursLabel").getExpression("innerHTML") + "."); }
    </script>
    </head>
    <body onload="init()">
    <h1>getExpression(), setExpression(), recalc() Methods</h1>
    <hr />
    <p>This clock uses Dynamic Properties to calculate bar width and time
    numbers:</p>
    <table border="0">
    <tr>
    <th>Hours:</th>
    <td><span id="hoursBlock" style="background-color:red"></span>
    &nbsp;<span id="hoursLabel"></span></td>
    </tr>
    <tr>
    <th>Minutes:</th>
    <td><span id="minutesBlock" style="background-color:yellow"></span>
    &nbsp;<span id="minutesLabel"></span></td>
    </tr>
    <tr>
    <th>Seconds:</th>
    <td><span id="secondsBlock" style="background-color:green"></span>
    &nbsp;<span id="secondsLabel"></span></td>
    </tr>
    </table>
    <hr />
    <form>
    <input type="button" value="Show 'Hours' number innerHTML Expression" onclick="showExpr()" />
    </form>
    </body>
    </html>
    这段代码中的button是白板一个。
    下面我再贴的这段button则可以正常显示。但我没能观察出二者有何区别?
      

  2.   

    <html>
    <head>
    <title>canHaveChildren Property</title>
    <script type="text/javascript">
    function colorAll() {
    var elems = document.all;
    for (var i = 0; i < elems.length; i++) {
    elems[i].style.color = "red";
    }
    }
    function colorChildBearing() {
    var elems = document.all;
    for (var i = 0; i < elems.length; i++) {
    if (elems[i].canHaveChildren) {
    elems[i].style.color = "red";
    }
    }
    }
    </script>
    </head>
    <body>
    <h1>canHaveChildren Property Lab</h1>
    <hr />
    <form name="input">
    <input type="button" value="Color All Elements"
    onclick="colorAll()" /><br />
    <input type="button" value="Reset" onclick="history.go(0)" /><br />
    <input type="button"
    value="Color Only Elements That Can Have Children"
    onclick="colorChildBearing()" />
    </form>
    <br />
    <hr />
    <form name="output">
    <input type="checkbox" checked="checked" />Your basic checkbox <input
    type="text" name="access2" value="Some textbox text." />
    </form>
    <table id="myTable" cellpadding="10" border="2">
    <tr>
    <th>Quantity</th>
    <th>Description</th>
    <th>Price</th>
    </tr>
    <tbody>
    <tr>
    <td width="100">4</td>
    <td>Primary Widget</td>
    <td>$14.96</td>
    </tr>
    <tr>
    <td>10</td>
    <td>Secondary Widget</td>
    <td>$114.96</td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>
      

  3.   

    个人觉得js难就难在兼容问题。现在明白为什么看似简单的js
    一本书就1700多页。向每一位scripter致敬!