HTMLInputElement has no method 'val'

前端 未结 5 925
走了就别回头了
走了就别回头了 2021-02-05 02:28

I\'m looping through cells in a table row. each cell has a text box in it, and I want to take the value of the text box and push it onto an array.

function dothi         


        
5条回答
  •  余生分开走
    2021-02-05 03:00

    .val() is a jquery method. Using [0] returns the DOM element, not the jquery element

    var val = $(this).children('input:first').val();
    

提交回复
热议问题