adding variables with javascript for outcome number what is random made
<p><strong>Greetings everyone,</strong></p>

<p>Can someone check out the code, i made somewhere a mistake but, i have no clue what i done wrong here. Only know is, that i get time to time <strong>undefined</strong> on my screen. I might do something wrong on this approach, if i do...i like to know the fix.</p>

<p>I checked the internet for more examples, but....i saw no result that was close on what i wanted to do.</p>

<p>What i like to archive is, with pressing a button, that it gives multiple outcomes of skills, based on the random number we rolled.</p>

<p><strong>Here is the code i am talking about:</strong></p>

<pre><code>&lt;script&gt;
function rollDiceSkill(){
    var die3 = document.getElementById("die3");
    var d1 = Math.floor(Math.random() * 100) + 1;
    var diceTotal = d1;
    var SkillNr;
    if (diceTotal &gt; 40) {
        SkillNr = "Skill 1";
    } else
    if (diceTotal &gt; 70) {
        SkillNr = "Skill 2";
    } else 
    if (diceTotal &lt; 71) {
        SkillNr = "Skill 3";
    }
    intothis.innerHTML = "&lt;b&gt;&lt;font size='40'&gt;Enemy Use:&lt;/font&gt;&lt;br&gt;&lt;font size='40' color='#00CC00'&gt;"+SkillNr+"&lt;/font&gt;&lt;/b&gt;"
    }
&lt;/script&gt;
</code></pre>

<p>What i like to know too about this kind of javascripts, how do i do adding more variables in the outcome. So, that i can add more skills for example.</p>

<p>Thank you!</p>

<p><strong>EDIT:</strong></p>

<p>I was forgotten to say, i am using this in Bootstrap 3.</p>