A Pen by Yerlin Matu on CodePen.
Last active
July 8, 2017 06:44
-
-
Save YerlinMatu/bcdbe52e9e197431cb6779b7deb90281 to your computer and use it in GitHub Desktop.
Buenas prácticas JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="btn">Like</button> | |
<span id="mostrar">0</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let btn = document.querySelector('#btn'), | |
span = document.querySelector('#mostrar'), | |
like = 0; | |
function addLike () { | |
return ++like; | |
} | |
btn.addEventListener('click', () =>{ | |
span.innerHTML = addLike(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like++