Created
May 15, 2017 07:26
-
-
Save pilzze/b3d2a595f00c47e4862060422bc55432 to your computer and use it in GitHub Desktop.
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
var lessons = document.getElementsByClassName("lessons-left"); // get the lessons | |
var tempLessons = []; // temporary array | |
for(i=0; i<lessons.length; i++) { | |
tempLessons.push(lessons[i].innerText);//clean the html | |
} | |
lessons = tempLessons;//restore original array name | |
var s = 0; // initalize a var fo sum | |
for(i=0; i<lessons.length; i++) { | |
if (lessons[i] !== '') {//catch if nulled value | |
s+=parseInt(lessons[i][2]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment