Type the following to create a variable containing your first name.
var toName = "your name";
Type the following to create a variable containing the person the letter is from:
var fromName = "The Grammy Awards";
You can change The Grammy Awards to anyone you’d like to get a letter from.
Type the contents of your letter into a variable.
Use <br> to insert line breaks and don’t press Return or Enter until after you type the semicolon.
Here’s an example of the letter:
var letterBody = "We are pleased to inform you that your song, 'Can't Stop Coding!,' has been voted the Best Song of All Time by the awarding committee.";
Write document.write() statements to output each of the three parts of your letter.
document.write("Dear " + toName + ",<br><br>"); document.write(letterBody + "<br><br>"); document.write("Sincerely,<br>"); document.write(fromName);
When your letter is done, it should resemble the one shown here.A fully customized letter displayed in the browser.