If ElseIf Else in JavaScript

<script type="text/javascript">
var country = "Germany";
if (country=="Spain")
{
x="I am in Spain";
}
else if(country == "Germany"){
x="I am in Germany";
}
else
{
x="I am Somewhere else";
}
document.write(x);
</script>