Ok so I have this simplified code of what I am trying to do on this page. I want the browser to display a prompt as soon as they load the page asking for their name. Once they answer what their name is it takes that variable (name) and writes it inside of the div with the id "welcomeText". It just won't work for some reason... Please help thanks.
Heres my code. Put it all inside of a html index to make it easier to read.
<title>Welcome to Validus</title>
<style>
#welcomeText {
font-family:Verdana;
font-size:12px;
color:black;
width:100px;
height:100px;
margin:0px auto;
}
</style>
<script type="text/javascript">
var name=prompt("Hey! Welcome to Validus! Whats your name?", "Name");
document.getElementById("welcomeText").innerHTML = "Hey" + " " + name + "! " + "Welcome to validus...";
</script>
</head>
<body>
<div id="welcomeText">
</div>
</body>