JasonChan
18 Jan 2007, 01:51 AM
Need some help fixing this. basically, i want the second document.write to start on a new line and i am using the "\n" escape code but it is not working. I tried putting the <pre> tag around the script and it still doesnt work. Whats going on here?
<html>
<head>
<title>Javascript Run</title>
</head>
<body>
<script type="text/javascript">
var firstName = prompt("Please type in your name", "What is your first name?");
var thirdLetter = firstName.charAt(2);
alert("Hello "+firstName);
document.write("The third letter of your name is "+thirdLetter\n);
document.write("That is your character right ?");
</script>
</body>
</html>
<html>
<head>
<title>Javascript Run</title>
</head>
<body>
<script type="text/javascript">
var firstName = prompt("Please type in your name", "What is your first name?");
var thirdLetter = firstName.charAt(2);
alert("Hello "+firstName);
document.write("The third letter of your name is "+thirdLetter\n);
document.write("That is your character right ?");
</script>
</body>
</html>