Jump to content

Using document.writeln()


locbtran

Recommended Posts

I'm sorry if this question seem very basic but I just start learning javascript.I would like to display an image but not sure why it is not working. In a nutshell, here's my code

<html><head></head><body><script type="text/javascript">document.writeln("<img src=/"xMark.jpg /" width=25 height=25 >");</script></body></html>

thanks

Link to comment
Share on other sites

Change "/" to "\", like:

<html><head></head><body><script type="text/javascript">document.writeln("<img src=\"xMark.jpg\" width=25 height=25 >");</script></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...