Aleksandar Aleksandar - 1 year ago 88
Javascript Question

I do not see displaying a unique object ID in JavaScript

On the screen we show four strings, but when I click on the latest string only he does, why does not work the first three links?

[enter link description here]


Answer Source


document.getElementById("show_test").innerHTML += '<div><a href="#" id="bt_' + item + '">click</a></div>';


var el = document.createElement("div");
var a =  document.createElement("a");
a.innerHTML = "click"; = "bt_" + item;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download