jQuery dynamic selector

You should use the val() function:

var myValue = $("#new_grouping_"+i).val(); // to get the value

$("#new_grouping_"+i).val("something");    // to set the value 

Leave a Comment