Jump to content

Drawing an image in document.write()


mike_g

Recommended Posts

I want to draw an image in a Javascript function. I can't seem to get it to work. Heres an example of what I am doing:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>Untitled</title><script language="JavaScript" type="text/javascript">function DrawRow(img){ 		document.write("<img src='"+img+"' alt='not working' />");}</script></head><body><img src="Images\Rompersuit.jpg" /><script>DrawRow("Images\Rompersuit.jpg")</script></body></html>

Can someone please tell me how I could get this to work. Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...