Simple javascript document.write isn't working
<p><a href="http://www.jsfiddle.net/T6Jqx/13/" rel="nofollow">Here's the code in question</a></p>

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

<p>I want to test this out by performing a simple <code>document.write(regionId)</code> 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? </p>

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