Last active
April 11, 2018 11:42
-
-
Save sifue/575ae2331d4f7cffc0575d6e5634849b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const btn = $('#btn'); | |
const mixtanisuu = $('#mixtanisuu'); | |
const mixkamoku = $('#mixkamoku'); | |
btn.click( () => { | |
const paragraph = document.createElement('p'); | |
paragraph.classList.add('kamoku'); | |
const text = document.createTextNode(document.getElementById('kamoku').value); | |
paragraph.appendChild(text); | |
mixkamoku.append(paragraph); | |
let sum = 0; | |
$('.kamoku').each(function() { | |
sum += parseInt(this.textContent); | |
}); | |
mixtanisuu.text(sum); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment