I would like to create _blank
with js HTML DOM, is it correct?
var a = document.createElement('a');
a.appendChild(document.createTextNode(contacts[i][j]));
a.setAttribute("href","http://www.facebook.com/", contacts[i][j],"target","_blank" );
td.appendChild(a);
I think you should spilt the setAttribute
like:
a.setAttribute('href', 'http://www.facebook.com/');
a.setAttribute('target', '_blank');
According to the docs it takes only two parameters.
The setAttribute method accept only 2 parameters
var a = document.createElement('a');
a.appendChild(document.createTextNode(contacts[i][j]));
a.setAttribute('href', 'http://www.facebook.com/');
a.setAttribute('target', '_blank');
td.appendChild(a);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With