getting the value of dynamically created textbox using jquery

前端 未结 6 934
悲&欢浪女
悲&欢浪女 2020-12-18 09:50

I\'m having a hard time with getting the value of my dynamically appended textboxes. I\'m using the $.each function to iterate all of the textboxes according to

6条回答
  •  执笔经年
    2020-12-18 10:38

    You do not have element with id student_grde_G[] Use wild card starts with.

    Live Demo

    $('#save_grade_button').click(function () {
      $.each($('[id^=student_grde_G]'), function (i, item) {
        var grade = $(this).val();
        alert(grade);
      });
    });
    

提交回复
热议问题