2
rated 0 times
[
3]
[
1]
/ answers: 1 / hits: 15649
/ 12 Years ago, wed, september 19, 2012, 12:00:00
I'm trying to use appendChild within Javascript to create a link that has a onClick attribute. I can't seem to make it work or find how to do this simple task.
var link=document.createElement(a);
link.appendChild(document.createTextNode(Link));
link.href = '#';
link.onclick = 'loadScript()';
document.body.appendChild(link);
More From » appendchild