Jump to content

Key skills for basic JS.


david1972

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...