JavaScript Beginner Course

Cheatsheet
Exercise Answers
Code in Progress

Exercise Answers

Exercise 1
We learned alert('hello'); to create a popup with the text hello. Now create a popup with your name in it.

alert('Simon');

Exercise 2
Display today’s date in the Console in Chrome.

console.log('Thursday, October 14, 2021');

Exercise 3
Overwrite the webpage using document.body.innerHTML so that the page just displays your name.

document.body.innerHTML = 'Simon';

Exercise 4
Overwrite the webpage to be empty.

document.body.innerHTML = '';

Code in Progress

todo.html
<button>Press me</button>
<script>
  alert('hello');
</script>