{"size": 1001, "ext": "js", "max_stars_repo_path": "javascript.js", "max_stars_repo_name": "tekuto1437/todolist", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "javascript.js", "max_issues_repo_name": "tekuto1437/todolist", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "javascript.js", "max_forks_repo_name": "tekuto1437/todolist", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.8055555556, "max_line_length": 64, "alphanum_fraction": 0.4925074925}
window.onload = function () {

    var todoList = [];
    if (localStorage.getItem('todo')!=undefined){
        todoList = JSON.parse(localStorage.getItem('todo'))
        out();
    }

    document.getElementById('add').onclick = function(){
        var d =document.getElementById('in').value;
        var temp = {};
        temp.todo = d;
        temp.check = false;
        var i = todoList.length;
        todoList[i] = temp;
        console.log(todoList);
        out();
        localStorage.setItem('todo', JSON.stringify(todoList) );
    }

    function out() {
        var out ='';
        for (var key in todoList){
            out += todoList[key].todo + '<br>';
            if (todoList[key].check == true) {
                out += '<input type="checkbox" checked>';
            }
            else {  
                out += '<input type="checkbox">';  
            }
            out += todoList[key].todo + '<br>';

        }
        document.getElementById('out').innerHTML = out;
    }
}