Skip to content

Instantly share code, notes, and snippets.

@ark234
Last active November 15, 2017 15:44
Show Gist options
  • Save ark234/58fdfaea85396a9919eaa110e082c4cc to your computer and use it in GitHub Desktop.
Save ark234/58fdfaea85396a9919eaa110e082c4cc to your computer and use it in GitHub Desktop.
Task 3.2
<!DOCTYPE html>
<html>
<head>
<title>Task 3.2</title>
</head>
<body>
<h1>JavaScript Variables</h1>
<p id="UID">In this task, x, y, and z are variables</p>
<script>
var x = 5;
var y = 7;
var z = x + y;
// Use backticks for string interpolation (template literals).
// ${expression} inside backticks will evaluate it to its value.//
document.getElementById('UID').innerHTML = `x + y = ${z}`;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment