Jump to content

Using document.writeln()


locbtran
 Share

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

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
 Share

×
×
  • Create New...