I have a following variable
var $pk3s_c = $('<input id = query_form_tbl_info_'+query_index +'_pk3ss[] name =query_form[tbl_info]['+query_index+'][pk3ss][] type = hidden></input>');
and an array
var pk3s = opts[tbl]["cols"];
during iteration through the array, I want to append the elements of an array to $pk3s_c
$.each(pk3s, function(i,pk3){
$pk3s_c.attr('value',pk3);
})
the code above is not working, it shows me that I have appended only last element of a pk3s, and not all of them. How can I append each element of p3ks into my hidden input?