Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

dev7
Guest
How would you make the contents of a variable in JS show up as an ID in say a span. I was thinking..


<span id="sId"></span>


<script>
var test = "content"
test.Id = "sId"
</script>

???


Chris

Chris Avatar

******
Head Coder

19,519


June 2005
docucument.getElementById("sId").innerHTML = test;

:)

dev7
Guest
Docucument lol. :P
I'll try that. :D
Doesn't work.


Last Edit: Sept 9, 2006 1:20:25 GMT by dev7

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Yeah, ignore my typo. :P

<span id="sId"></span>
<script>
var test = "whee";
document.getElementById("sId").innerHTML = test;
</script>


That should work fine.

dev7
Guest
Yep, it gives me ideas too. Thanks :D

newBookmarkLockedFalling