This is probably a simple question ( or I assume to be ) however, I still can't get it to work no matter how much i twinker with it. I am trying to write a variable inside a li tag. This variable should hold the text within another div tag like so:
<script type="text/javascript">
var item = document.getElementById('thistext').innerHTML;
function songlist () {
document.write("<div class='overview'><ul><li> item </li></ul></div>");
}
</script>
<div id="thistext">hello</div>
<!-- I want it to appear here -->
<div class="viewport">
<script type="text/javascript">
songlist ();
</script>
</div>
So basically I need the text within "thistext" div tag to appear within the li tag which is within the ul etc (I don't know if thats unnecessary info or not ) I've also tried putting the script and its function within the viewport tag itself and with:
document.getElementById("id").innerHTML = "value";
that layout too but it doesn't appear to be showing working and I can't seem to understand why. I'm looking forward to the responses and thanks in advance.