This is becoming very frustrating so I'm hoping someone is able to help. I am not a great JavaScript or JQuery developer (more of back-end guy) but I've searched high and low for a solution to this and nothing seems to help. This is a simplified version of my problem...

```
<script language="JavaScript" type="text/javascript">
fooey = 'baaa';

jQuery(document).ready(function($) {

fooey = 'New value';     

});

alert("value: " + fooey);  // I need this to be 'New value'

</script>

```

How can I change the fooey variable inside the JQuery block then access this new value from outside of the JQuery block. So I'm expecting the alert popup to show 'New value' not 'baaa'.