Simple javascript document.write isn't working...

Posted by Jascination on Stack Overflow See other posts from Stack Overflow or by Jascination
Published on 2010-12-30T01:43:47Z Indexed on 2010/12/30 1:54 UTC
Read the original article Hit count: 256

Filed under:
|

Here's the code in question

I'm trying to create a simple application - each of the three men has a rel="x" attribute attached them. I'm using var regionId = $('img.selected-region').attr('rel'); to make the rel of the currently selected item the value of reginId.

I want to test this out by performing a simple document.write(regionId) command in a div under the pictures of the men. However, it's not working. Have I put the var regionId definition in the right place in the script window?

I'm completely new to javascript so the syntax is confusing to me - and help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about code