...

View Full Version : Returning Variables in Alerts



Porygonix
08-04-2002, 05:15 PM
I'm making something that asks for your name (prompt) and then says 'Hey so-and-so' via alert.

var x = prompt("What's your name/nickname?")
alert("Hey document.write(x)!")

It doesn't carry out the command. It says it how it is. How do I get it to say the variable in the alert?

boywonder
08-04-2002, 05:36 PM
var x = prompt("What's your name/nickname?", "");
alert("Hey "+x+"!");



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum