+ 1
Passing Id
I made a code in js to pass the elements I'd but the script is not working on my desktop win vista. tried it with chrome and firefox. does anyone knows a solution? that's the code: https://code.sololearn.com/W0IPKZRI11ii/?ref=app
4 ответов
+ 2
Your code is working fine.
One problem I can see is, in your html, you're calling 'function a' with an argument 'this.id' but in your JS, the 'function a' isn't accepting any arguments.
I think, you want to create something like this..
function a(id){
var p = document.createElement("p");
var node = document.createTextNode("Some new text");
p.appendChild(node);
var div = document.getElementById(id);
//adding the paragraph to the div
div.appendChild(p);
};
+ 2
So, the problem is with win Vista, maybe?
+ 1
that's not the thing I was writing the code while you where looking now the code is finish.
on my desktop is even thefunction:
function sth (id){alert (id);}
not working. I called it with onclick
0
it's a new link this one: https://code.sololearn.com/W9XLju7KDlXS/?ref=app