Facebook
Banner
XMPP JavaScript Library READ MORE

Dynamicaly Adding Images to a DIV Using JavaScript

JavaScript, Sachin Puri, 2010-04-25 22:00:59

<HTML>
<HEAD>
<TITLE>Dynamicaly Adding Images to a DIV Using JavaScript</TITLE>
<script>
    function fill_div()
    {
        document.getElementById("result").innerHTML="<img src='img.jpg'/>";
    }
</script>
</HEAD>

<BODY>

<input type="button" value="Add Image to DIV" onClick="fill_div()">
<br>
DIV to be filled with image:
<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 簡愉庭 on 04-Jun-2019 04:06 pm
asfdsafd
  • Reply
  •  3 Like
  •  3 Dislike
  • Report
  by sdfsdfs on 27-Aug-2018 01:00 pm
fdsfdsfdsfs
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by James on 23-Dec-2017 01:04 am
I'm truly enjoying the design and layout of your blog. It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Outstanding work!
  • Reply
  •  2 Like
  •  3 Dislike
  • Report
  by das on 18-Dec-2017 01:20 pm
asds
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by James on 09-Dec-2017 09:49 pm
Aw, this was a very nice post. In thought I want to put in writing like this moreover taking time and actual effort to make an excellent article but what can I say I procrastinate alot and not at all seem to get something done.
  • Reply
  •  3 Like
  •  2 Dislike
  • Report
  by James on 15-Nov-2017 11:16 pm
Good blog! I really love how it is easy on my eyes and the data are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your feed which must do the trick! Have a nice day!
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by James on 15-Oct-2017 06:23 am
Definitely, what a fantastic website and informative posts, I definitely will bookmark your blog.All the Best!
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by James on 15-Oct-2017 06:21 am
Definitely, what a fantastic website and informative posts, I definitely will bookmark your blog.All the Best!
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by James on 07-Oct-2017 04:08 am
You are a really persuasive writer. I can see this in your writeup. You've a way of writing compelling info that sparks significantly interest.
  • Reply
  •  2 Like
  •  2 Dislike
  • Report
  by priya on 28-Jul-2015 12:27 pm
hello welcome
  • Reply
  •  2 Like
  •  202 Dislike
  • Report
  by motilalyadav on 09-Feb-2015 07:30 pm
hi how are u
  • Reply
  •  2 Like
  •  2 Dislike
  • Report