How can I get values of inputs that have the same class using JQuery each?

前端 未结 4 1121
灰色年华
灰色年华 2021-01-28 07:32

This should be easy, but I can\'t seem to get it right.

var totalHours = 0;
this.$(\".timesheet-daily-input\").each( function () {
    var inputValue = $(this).t         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-28 08:06

    Get rid of the this. before $(".timesheet-daily-input") and use $(this).val() to get the value of the inputs.

提交回复
热议问题