I have several fields dynamically created on my page. I use the following function in order to align the ID field of that row with the correct "ntheme" field of that row.
$(document).on('change', 'select', function() {
var checkbox = $(this),
otherInput = $('nrowid' + this.id.replace('ntheme', ''));
console.log(otherInput);
console.log($(this).val());
for(var i=0;i<rows1;i++){
if($(this).val()==themes[i].Themes){
//set value of otherinput to themes[i].ID
}
}
console.log(otherInput.val());
});
Is there a way I can set the value of the otherInput field and then return that value using console.log?