Below JavaScript function is called after selecting option from `<select>` tag.

```
function function1()
{
var country=document.getElementById('id1').value;
switch(country)
{
 case "India":
     logo="rupee.png";
     break;
 case "US":
     logo="dollar-logo.png";
     break;
 case "Britan":
      logo="yen.png";
      break;
}

```

Now i want to display flag of country according to selection has made..
Below is HTML file where i want to display image..

```
<td><img src="+logo+" width=30 height=30></td>

```

I also tried this one..

```
<td><img src="<%Eval(logo)%>" width=30 height=30></td>

```
['https://Stackoverflow.com/questions/26717000', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4147229/']
This is standard behavior in the Groovy shell, not peculiar to the Grails shell. You probably don't want to `def` the variable. See the following:

```
~ $ groovysh
Groovy Shell (2.3.4, JVM: 1.7.0_45)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------
groovy:000> def x = 42
===> 42
groovy:000> x
Unknown property: x
groovy:000> y = 2112
===> 2112
groovy:000> y
===> 2112
groovy:000>

```

From <http://beta.groovy-lang.org/groovysh.html>

> 
> **1.3.4. Variables**
> 
> 
> Shell variables are **all** untyped (ie. no `def` or other type information).
> 
> 
> This will set a shell variable:
> 
> 
> 
> ```
> foo = "bar"
> 
> ```
> 
> But, this will evaluate a local variable and will **not** be saved to the shell’s environment:
> 
> 
> 
> ```
> def foo = "bar"
> 
> ```
> 
> 

You can change this behaviour by enabling [interpreterMode](http://groovy-lang.org/groovysh.html#GroovyShell-InterpreterMode "interpreterMode")

```
groovy:000> := interpreterMode
groovy:000> def x = 42
===> 42
groovy:000> x
===> 42
groovy:000>

```
"def" are more like compiled variables in Java way (to some degree), compiled (maybe type is unknown/dynamic, but name/existence of variable / property is known). 

`def xyz = 1` -> `Object xyz = 1;`

Without "def" are added to specific container Binder by name, in fully dynamic manner. Imagine this like specific Map *(sorry for simplicity)*

```
binder["xyz"] = 1;

```

My personal filling is that Groovy doc don't illustrate this (huge) difference clearly. Word "untyped" seems to weak. 
Implementation of "storage" for this two is totally different.