document.font1.input1 //访问表单元素

解决方案 »

  1.   

    上面写错了,是document.getElementById() 如果用document.font1.input1,是不是也要从头搜索一次呢?
    我开始并不知道是访问哪个input1,那如何构造document.font1.input1这个句子?
      

  2.   

    如果知道当前要访问的是font1中的input1,如何构造document.font1.input1这个句子?
    同时问一下,在<input name="input1" id="inputId1" value="input1value"/>是不是这样得到value? document.font1.input1.value ?
      

  3.   

    若你想得到某个元素的值,最好这样用
    document.all("XX").value
    document.getElementById();一般是进行特殊处理的时候才用的
      

  4.   

    没试过. 不过按 html dom ,
    在某 path 下 GetElementById 应该也是可行的.
    所以我想: document.all.Table1.GetElementById 在 Table1 里找...
      

  5.   

    document.getElementsByTagName("INPUT")
      

  6.   

    -----------------------------------
    >>document.all("XX").value
    all中的参数是什么?>>document.all.Table1.GetElementById 在 Table1 里找...
    如果我要在form中找呢?而且我要找的form是一个变量,如何构造上面句子?>>document.getElementsByTagName("INPUT")
    html 中有好多input啊,上面这条方法找到的是哪一个?!!!!最重要的问题就是: 哪个方法的效率高?比如我知道input一定在form里面,就不要到form里面的table中找了。-----------------------------------
      

  7.   

    对了,我要得到的是一个object
      

  8.   

    document.getElementsByName("INPUT")
    document.getElementsById("INPUT")
      

  9.   

    document.getElement("ID")
    ->document.getElementById("ID")