A barebones example of taking text input from a user and programmatically using it elsewhere in your page/project.
Modify the code so that:
- …the submission is only added if it contains only letters and whitespace (i.e. it should either throw an error message—or just do nothing—if I enter a
1
). - …the submission is not just added to the DOM, but to
localStorage
- …when a user visits the page again after having submitted something in the past, they see their old submissions there (again, via
localStorage
)
- MDN's reference on the
<input>
element