answersLogoWhite

0


Best Answer

<script type="text/javascript"> var image = new Image;

image.src = "imageurl.png";

document.body.appendChild(image);

</script>

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you insert an image in javascript?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you insert a cookie using javascript?

modify document.cookie


How do you insert logo image on signature from rediffmail?

You can download the image from rediff mail. Then can insert this image as image source.


How do you perform image slideshow in php?

Image Slideshow is very difficult using php. Instead store the image files in an image folder and apply slideshow to them using javascript. Here's a reference to automatic slideshow using javascript: How_do_you_create_slide_show_using_javascript_code


Can insert javascript coding in servlet?

No. Javascript code can be present inside a JSP but not inside a servlet. A Servlet is a pure java class.


What are the steps for inserting an image in notepad?

You can not insert an image in Notepad as it is a plain-text editor. If you would like to insert an image into a document, use Wordpad (the button is at Insert --&gt; Image in Windows 7)


Can you insert an image in table header in HTML?

Yes, you can insert an image anywhere in the code. You just have to insert the img tag before the area you want to insert it.


What is returned from a custom object constructor in javascript?

A JavaScript constructor will return an instance of the object. So var ourImg = new Image(); Gets us a new Image object. The same goes for a custom element.


How do you cut and paste an image from Google images?

by clicking right click and selecting save as.....then ur image wil be saved


Insert date on a webpage using javascript?

Just use new Date(); to get the current date and then use document.getElementById to insert it on the webpage. &lt;div id="example"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; document.getElementById('example') = new Date(); &lt;/script&gt;


How do you do an image rollover in Javascript?

Easy, Reusable Image Rollovers with jQuery http://www.atlantajones.com/2007/09/27/easy-reusable-image-rollovers-with-jquery/


Which HTML tell the browser when the image can't be located?

HTML can't do this. It doesn't have built in logic. But you can detect a missing image using Javascript.


What is an example of a JavaScript statement being used to create an object used to hold a graphic image?

1) myImage = new Image 2)blueArrow = new Image 3)redArrow = new Image 4)something = new Image