FF、IE下表单的取值问题

来源:互联网 发布:python量化交易pdf 编辑:程序博客网 时间:2024/06/05 14:41
IE可以根据Name直接取值,FF不能(在表单中FF不能取值)
如下:
  1. <script>
  2. function getValue0()
  3. {
  4. alert(text2.value);
  5. }
  6. function getValue1()
  7. {
  8. alert(text2.value)
  9. }
  10. </script>
  11. <form name="frm">
  12. <input type="text" name="text1" />
  13. <input type="button" onclick="getValue1()" value="取值">
  14. </form>
  15. <input type="text" name="text2" />