JavaScript JavaScript Basics Storing and Tracking Information with Variables Create a variable with a string

Garry nosirov
Garry nosirov
1,363 Points

Use the document.write() function to print the contents of the player variable to the page.

var player='Jasmine'; document.write("Jasmine");

app.js
var player='Jasmine';
document.write('Jasmine');
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>

1 Answer

Brendan Whiting
MOD
Brendan Whiting
Front End Web Development Treehouse Moderator 77,564 Points

They want you to pass in the player variable into document.write, rather than the same string again.

var player = "Jasmine";
document.write(player)