View Full Version : A basic name prompt
10-11-2003, 04:12 AM
--For example: If I wanted someone named John to type their name in, I'd want the page's marquee to display "Welcome to my site, John!"
-I'm new, so I would definitely appreciate any help or comments. Thanks! :thumbsup:
10-11-2003, 04:30 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
var user, marquee;
user = window.prompt("Name: ", "");
user = (user) ? user : 'Guest';
marquee = document.createElement("marquee");
marquee.setAttribute("style", "color: #0000ff; font-family: helvetica, serif; font-size: 20pt;");
marquee.innerHTML = "Welcome to my site, " + user + "!";
document.body.appendChild( marquee );
onload = init;
10-11-2003, 05:25 AM
wow that was quick Fred, thank you :p
10-11-2003, 05:26 AM
You're welcome. :D
Doesn't that create a <marquee> tag? There are better ways of doing that, as marquee is depreciated ;)
10-12-2003, 02:19 PM
Any other ways would be helpful as well, but until then I'll just stick with Fred's way. :D Go fred
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.