How can I get the value of an input in a specific table cell using javascript?

后端 未结 4 873
暖寄归人
暖寄归人 2020-12-18 06:43

I\'m wondering how can I get the value of an input in a specific table cell using javascript?


         


        
4条回答
  •  别那么骄傲
    2020-12-18 07:15

    You can use querySelector() DOM method:

    document.querySelector('#tabela tr:nth-child(2) td:nth-child(3) > input').value
    

    JSFiddle

提交回复
热议问题