Your Ad Here

Posted By

anvilcity on 08/04/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

thiswayup


Writing to a div in pure JavaScript


 / Published in: JavaScript
 

  1. If the div just contains text:
  2. document.getElementById('elmID').firstChild.data="new text";
  3.  
  4. If it contains elements:
  5. document.getElementById('elmID').innerHTML="<strong>new text</strong>";

Report this snippet  

You need to login to post a comment.