david1972 Posted October 24, 2022 Share Posted October 24, 2022 JS is slowly sinking in. If you can handle event listeners, the DOM, get and set values, then you can do most things? querySelector const $ = selector => document.querySelector(selector); using querySelector's const score = parseInt($("#score").value); arrow function example const addScore =()=> { code lines }; .value function get input const variableName = parseInt($("#id").value); .value function set input $("#id").value = ""; DOMContentLoaded document.addEventListener("DOMContentLoaded", ()=> {function calls} ); addEventListener to button $("#id").addEventListener("click", functionName); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now