confused....

0 Yaritza Ortiz · July 13, 2015
I assigned my name variable as you instructed but when I saved it with "is my name" all it printed was just that, "is my name"
It didn't assign my actual name as the variable it seems.... Some help would be great. This is my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
</head>
<body>

<script type="text/javascript">
var name = "Yari";
var age = 33;
document.write(name = " is my name.");
</script>

</body>
</html>

Post a Reply

Replies

Oldest  Newest  Rating
0 Tincu Andrei · July 13, 2015
document.write(name + "  is my name.");

the output will be:  Yari is my name.
Put a space between " and is (" is my name"), if not the output will be Yariis my name.
0 Yaritza Ortiz · July 15, 2015
Thanks! I figured it out after I stepped away from the computer for the night. Overthinking again....
  • 1

Javascript

107,050 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators