javascript - How to get a textarea element in jquery when the name is in a variable -
i trying populate multiple text areas single select button . application cant use else (esp id's) textareas dynamically created , named in order tx1 , tx2 ... txn.
my code ....
var count = 13; for(var i=1;i<count;i++ ) { var txtname = 'tx' + i; var txt1 = $('textarea[name=txtname]'); var seltxt1 = $(this).find("option:selected").attr('text'); .....
.....
but var txt1 = $('textarea[name=txtname]');
not work !!! how provide dynamically created name of txtaarea var txt1 .
like -
$("textarea[name="+txtname+"]");