Posted by: Sourav | January 30, 2012

Take an input and make if else decision


<script>
var cash=prompt(“How much do you have”,””);
if(cash > 70)
{
 alert(“We are going to the movie”);
}

else if(cash > 50)
{
 alert(“We are going to dinner”);
}
else if(cash > 30)
{
 alert(“We are going to a friend’s house”);
}
else
{
 alert(“We are going to stay at home”);
}

</script>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: