show = function() {
    // alert('button is pressed!!!');
    var myscore;
    myscore = 0;

    if (document.getElementById('greenItem').checked) {
        document.getElementById('results').innerHTML = "Green is checked!!!";
        myscore = myscore + 2;
    }
    else if (document.getElementById('blueItem').checked) {
        document.getElementById('results').innerHTML = 
            "Maybe blue is checked!!!";
        myscore = myscore + 4;
    }
    else {
        document.getElementById('results').innerHTML = 
            "red is checked!!!";
        myscore = myscore - 2;
    }

    if (document.getElementById('vanillaItem').checked) {
        document.getElementById('results').innerHTML = 
          document.getElementById('results').innerHTML + "<br>Vanilla is checked!!!";
    }

    if (document.getElementById('chocolateItem').checked) {
        document.getElementById('results').innerHTML += "<br>Chocolate is checked!!!";
        myscore = myscore + 3;
    }

    if (document.getElementById('kiwiItem').checked) {
        document.getElementById('results').innerHTML += "<br>Kiwi is checked!!!";
        myscore = myscore + 5;
    }

    // take whatever count is in attemptCount (id) and make it 1 greater
    //document.getElementById('attemptCount').innerHTML = 
       // Number(document.getElementById('attemptCount').innerHTML) + 1;

    var attempts = Number(document.getElementById('attemptCount').innerHTML);
    attempts += 1;  // equivalent to ---> attempts = attempts + 1;
    document.getElementById('attemptCount').innerHTML = attempts;


    document.getElementById('score').innerHTML = "Score: " + myscore;

    if (myscore > 10) {
        document.getElementById('feedback').innerHTML = "You have exquisite taste!";
    }
    else if (myscore > 5) {
        document.getElementById('feedback').innerHTML = "You have nice taste!";
    }
    else {
        document.getElementById('feedback').innerHTML = "You have some taste!";
    }
}

init = function() {
    document.getElementById('showButton').addEventListener('click', show);
}
window.addEventListener('DOMContentLoaded', init);