function showContent($kaynak, $gosterilecekKonum) {
var $gosterilecekKonum = [];
for (var i = 0; i < $gosterilecekKonum.length; i++) {
var selected_secenek = document.getElementById($kaynak).value;
document.getElementById($gosterilecekKonum[i]).innerText = selected_secenek;
$($gosterilecekKonum[i]).attr('data-bid', selected_secenek);
};
}
Since the function is working for one of them and not the other, I can’t tell exactly what is going wrong from that function then. Possibly you’ve misspelled hrefDataAttr either in your JS or in the HTML, or forgotten to add id="hrefDataAttr" to something?