How to use document.getElementByName and getElementByTag?

前端 未结 6 1747
一生所求
一生所求 2020-11-29 08:38
 document.getElementById(\'frmMain\').elements

can i use like this

document.getElementByName(\'frmMain\').elements 
6条回答
  •  离开以前
    2020-11-29 09:22

    If you have given same text name for both of your Id and Name properties you can give like document.getElementByName('frmMain')[index] other wise object required error will come.And if you have only one table in your page you can use document.getElementBytag('table')[index].

    EDIT:

    You can replace the index according to your form, if its first form place 0 for index.

提交回复
热议问题