Skip to content

Instantly share code, notes, and snippets.

@YerlinMatu
Last active July 8, 2017 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YerlinMatu/bcdbe52e9e197431cb6779b7deb90281 to your computer and use it in GitHub Desktop.
Save YerlinMatu/bcdbe52e9e197431cb6779b7deb90281 to your computer and use it in GitHub Desktop.
Buenas prácticas JS
<button id="btn">Like</button>
<span id="mostrar">0</span>
let btn = document.querySelector('#btn'),
span = document.querySelector('#mostrar'),
like = 0;
function addLike () {
return ++like;
}
btn.addEventListener('click', () =>{
span.innerHTML = addLike();
})
@YerlinMatu
Copy link
Author

Like++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment