Your first JavaScript DOM exercise. Let's start simple.

Extend the JavaScript code below to interact with the displayed HTML elements. Once you click the button, the checkbox should be checked.

Confirm your code by clicking the button!

HTML snippet

<input id="checkbox" disabled/>
<label for="checkbox">checkbox</label>
<button type="button" id="button">Verify Code</button>

JavaScript snippet

const button = document.getElementById('button');
button.addEventListener('click', () => {
  // type in your code here
const button = document.getElementById('button');
button.addEventListener('click', () => {
  // type in your code here
});
});

Preview

image.png