|
ok.. so i have these functions which are all simular... I'd like to simplify it to just one function where i can use switch(id); where i want to use it. Help.
|
k
|
|
|
|
tried this?
function switch1(id){ var content = document.getElementById("info") var content2 = document.getElementById(id).innerHTML; content.innerHTML += content2 }
|
|
|
|
|
tried this? function switch1(id){ var content = document.getElementById("info") var content2 = document.getElementById(id).innerHTML; content.innerHTML += content2 }
function switch1(id){ var content = document.getElementById("info") var content2 = document.getElementById(id).innerHTML; content.innerHTML = content2 }
One little mistake. He wanted content.innerHTML = content2
|
Support Rob Scuderi, the #1 Penguins Defender!
"Behold: me! I have authority in this building."
|
|
|
|
Works like a charm. Thanks guys ^_^
|
k
|
|
|
|
no prob, oh and i added the "+=" so if you wanted to add two two different node's innerHTML to the same "info" node, it would work without replace it.
|
|
|
|
|
yes i know that much... i just couldn't figure out the id part... lol
|
k
|
|
|