Jump to content

unable to get DIV's content to change using javascript and DIV's id


jasonc

Recommended Posts

I am trying to get a div's content to change using javascript but for some reason it is not working and i get no errors looking at the error console.

 

the code that is waiting for the content...

<div style="font-weight: bold;">count = <div id="desc" style="float: left;"></div> descriptions to do.</div><br clear="all" />

 

the code that should change the content....

<? echo("<script type=\"text/javascript\">
document.getElementById('desc').value='" . $count . "';
</script>");
?>

 

when i view the source code the javascript lines show like so...

<script type="text/javascript">
document.getElementById('desc').value='373';
</script>

 

do i have the javascript correct ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.