Spot the bug in the save control

from Frontend development foundations
Node 24 beginner 4 min 2 issues to find

Find the accessibility and data-handling bugs in this generated save control.

HTML
<div class="save" tabindex="0">Save</div>
<p id="message"></p>
<script>
  const label = new URLSearchParams(location.search).get('label');
  const save = document.querySelector('.save');
  save.addEventListener('click', () => {
    message.innerHTML = `Saved ${label}`;
  });
  save.click();
</script>
Open in playground
Report an error