To : chuckcoin() ( ) 
确实如你所说  但不知道这是为什么呢 

解决方案 »

  1.   

    1.
    <input id="txt_price" type="text">  //这里创建了 id 为 txt_price 的对象控件
    <script language="javascript">
    var txt_price = document.getElementById("txt_price");//这样写没问题,因为已经有了 id 为 txt_price 对象控件
    </script>2.
    <script language="javascript">
    var txt_price = document.getElementById("txt_price");//这样写会提示找不到对象,因为执行到这里的时候还没有 id 为 txt_price 对象控件
    </script>
    <input id="txt_price" type="text">  //这里创建了 id 为 txt_price 的对象控件
      

  2.   

    多谢 chuckcoin() ( )
    结贴!