javascript - Loop the array and fill value in dynamic textbox in jquery -


here splitvalues contains array , .split class in multiline texbox generated dynamically want fill textbox array. have done not getting further?

function insertitems(splitvalues) {     $(".split").each(function () {                    if (splitvalues != "") {             $(this).val(splitvalues);//         }     }); } 

change this:

$(this).val(splitvalues);// 

to this:

$(this).val(splitvalues.join());// 

updates:

$(".split").each(function (i, elem) {                 $(this).val(splitvalues[i]);// }); 

updated demo suggested milind.


Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -