read a box
Read what someone typed into the box with id="name".
const name = document.querySelector('#name').value;The DOM and the browser console · In any playground, open Reference to copy these.
Read what someone typed into the box with id="name".
const name = document.querySelector('#name').value;A function the page can run (return it from setup). In the script, a ref's value is in .value.
function addPoint() {
score.value++;
}