Skip to content

Instantly share code, notes, and snippets.

@susanBuck
Created September 16, 2025 18:10
Show Gist options
  • Select an option

  • Save susanBuck/c6d044ece27b3af8d4915a7b54b6381e to your computer and use it in GitHub Desktop.

Select an option

Save susanBuck/c6d044ece27b3af8d4915a7b54b6381e to your computer and use it in GitHub Desktop.
Week 3 Task Set Tips
// Select the elements on the page we will alter
let num1Span = document.getElementById('num1');
let num2Span = document.getElementById('num2');
// Example numbers
let num1 = 5;
let num2 = 9;
// Update the elements on the page with the example numbers
num1Span.innerHTML = num1;
num2Span.innerHTML = num2;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo</title>
<link href=data:, rel=icon>
<script src='app.js' defer></script>
</head>
<body>
<h1>Demo</h1>
<p>
What is <span id='num1'></span> + <span id='num2'></span>?
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment