Facebook
Banner
XMPP JavaScript Library READ MORE

Fill DIV Dynamically using Java Script

JavaScript, Sachin Puri, 2010-04-25 22:03:06

<HTML>
<HEAD>
<TITLE>Fill DIV Dynamically using Java Script</TITLE>
<script>
    function fill_div()
    {
        document.getElementById("result").innerHTML="DIV filled dynamically using Javascript";
    }
</script>
</HEAD>

<BODY>

<input type="button" value="Fill DIV Dynamically" onClick="fill_div()">
<br>
DIV to be filled:
<DIV id="result" style="border:1px solid; width:200px; height:200px"></DIV>
</BODY>
</HTML>

Add Your Comment
   
    Yes! I want to receive all comments by email

  by Church on the hill mcminnville on 30-Oct-2018 05:44 pm
I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website.
  • Reply
  •  1 Like
  •  1 Dislike
  • Report
  by asas on 25-Jun-2013 04:52 pm
dsdsd
  • Reply
  •  1 Like
  •  1 Dislike
  • Report
  by asas on 16-Jun-2012 06:12 pm
sdsd
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by Niels on 11-May-2012 01:15 am
What if I want to get a full html document in it?
  • Reply
  •  19 Like
  •  4 Dislike
  • Report
  by Sachin PUri on 12-May-2012 12:23 am
You can do it but it but it is not recommended because in that case there will be two html,head,body,title tags.
  • Reply
  •  8 Like
  •  3 Dislike
  • Report
  by admin on 27-Sep-2011 12:25 pm
elegant, straightforward, wish I found this sooner
  • Reply
  •  27 Like
  •  3 Dislike
  • Report