Javascript: First drop-down box working yet other one isn't. Code is the same
<p>I am wanting to have nine drop-down boxes but currently only have two. The problem is that only one of them are working yet the code for both of them are the same apart from the obvious changes in ID's for different parts of the HTML.
When i click the first one ("mid_side_button") it works perfectly and displays the content that has been created using CSS. When i click the other button ("right_side_button"), it doesn't do anything.</p>

<p>Here is the relevant Javascript and HTML &lt; div > element containing the relevant sections.</p>

<p>Please do not take much notice of the CSS, it is only provided for further reference.</p>

<p>Please reply if any further information is needed.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>window.addEventListener('mouseup', function (event) {        /* one of many approaches to open a dropdown */
    "use strict";
    var rightdropdown = document.getElementById('right_side_dropdown_content');
    var rightdropdownbuttontoggle = document.getElementById('right_side_button');
    if (event.target !== rightdropdown) {
        rightdropdown.style.display = 'none';
    }
});
window.onload = function () {
    "use strict";
    var rightbutton = document.getElementById('right_side_button');
    /* creating variable "midbutton" and calling the ID "mid_side_button" */
    var rightdropdowncontent = document.getElementById('right_side_dropdown_content');
    /* same as above */
    document.onclick = function (e) {         /* creating function "e" */
        if (e.target === rightbutton) {
            /* if variable "midbutton" is clicked, display "middropdowncontent" */
            rightdropdowncontent.style.display = 'block';
        }
    };
};
window.addEventListener('mouseup', function (event) {        /* one of many approaches to open a dropdown */
    "use strict";
    var middropdown = document.getElementById('mid_side_dropdown_content');
    var middropdownbuttontoggle = document.getElementById('mid_side_button');
    if (event.target !== middropdown) {
        middropdown.style.display = 'none';
    }
});
window.onload = function () {
    "use strict";
    var midbutton = document.getElementById('mid_side_button');
    /* creating variable "midbutton" and calling the ID "mid_side_button" */
    var middropdowncontent = document.getElementById('mid_side_dropdown_content');
    /* same as above */
    document.onclick = function (e) {         /* creating function "e" */
        if (e.target === midbutton) {
            /* if variable "midbutton" is clicked, display "middropdowncontent" */
            middropdowncontent.style.display = 'block';
        }
    };
};</code></pre>
<pre class="snippet-code-css lang-css prettyprint-override"><code>.individual_left_side_links{
    margin: 0px;
    margin-right: 5px;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
    display: block;
    margin-bottom: 10px;
    box-shadow: 2px 2px 2px #888;
    background-image: -webkit-radial-gradient(left top, ellipse farthest-side, #8CFBFF 0%, #FFFFFF 100%);
    overflow: auto;
    width: 300px;
}
#vehicle_3_header{
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 5px;
    margin-bottom: 0px;
    padding: 0px;
    background-image: -webkit-radial-gradient(left top, ellipse farthest-side, #8CFBFF 0%, #FFFFFF 100%);
    width: 300px;
    float: right;
    border-bottom: 2px solid black;
}
.compare_sections_titles{
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 5px;
    margin-bottom: 0px;
}
#right_section{
    margin-left: 5px;
    margin-right: 5px;
    margin-bottom: 5px;
    margin-top: 0px;
    float: right;
    text-align: center;
    padding-top: 20px;
    padding-bottom: 50px;
    width: 300px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 2px #888;
    background-image: -webkit-radial-gradient(left top, ellipse farthest-side, #8CFBFF 0%, #FFFFFF 100%);
    overflow:auto;
}
#right_side_button{
    background-color: aqua;
    padding-right: 90px;
    padding-left: 90px;
    font-size: 16px;
    border: 1px solid grey;
    -moz-border-radius-topleft: 5px;
 border-top-left-radius: 5px;
 -moz-border-radius-topright: 5px;
 border-top-right-radius: 5px; 
    box-shadow: 2px 2px 2px #888;
}
#right_side_dropdown_content{
    display: none;
    position:absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    margin-left: 40px;
    text-align: left;
}
#right_side_dropdown_content a{
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}
#right_side_dropdown_content a:hover {
    background-color: #f1f1f1;
}
#mid_section{
    margin: 5px;
    float: left;
    width: 320px;
    text-align: left;
    padding-left: 10px;
    padding-right: 10px;
    background-image: -webkit-radial-gradient(left top, ellipse farthest-side, #8CFBFF 0%, #FFFFFF 100%);
    box-shadow: 1px 1px 2px 2px #888;
}
#mid_side_button{
    background-color: aqua;
    padding-right: 90px;
    padding-left: 90px;
    font-size: 16px;
    border: 1px solid grey;
    -moz-border-radius-topleft: 5px;
 border-top-left-radius: 5px;
 -moz-border-radius-topright: 5px;
 border-top-right-radius: 5px; 
    box-shadow: 2px 2px 2px #888;
}
#mid_side_dropdown_content{
    display: none;
    position:absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    margin-left: 40px;
    text-align: left;
}
#mid_side_dropdown_content a{
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}
#mid_dropdown_text{
    color: white;
    text-align:center;
}
#mid_side_dropdown_content a:hover {
    background-color: #f1f1f1
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="mid_container"&gt;
        &lt;header id="container_top_padder"&gt;
                &lt;li&gt;&lt;h2 id="individual_top_padder_text"&gt;Compare Vehicles&lt;/h2&gt;&lt;/li&gt;
        &lt;/header&gt;
        &lt;article id="left_section"&gt;
        &lt;nav id="left_side_nav"&gt;                    
                &lt;li&gt;&lt;a class="individual_left_side_links"&gt;Cars&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a class="individual_left_side_links"&gt;Bikes&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a class="individual_left_side_links"&gt;Trucks&lt;/a&gt;&lt;/li&gt;
        &lt;/nav&gt;
        &lt;/article&gt;
        &lt;article id="mid_section"&gt;   
                        &lt;p&gt;Title&lt;/p&gt;
                        &lt;p&gt;Subtitle&lt;/p&gt;
                        &lt;p&gt;Subtitle&lt;/p&gt;
                        &lt;p&gt;Subtitle&lt;/p&gt;
                        &lt;button id="mid_side_button"&gt;Make&lt;/button&gt; 
                        &lt;div id="mid_side_dropdown_content"&gt;
                        &lt;p&gt;&lt;a class="mid_dropdown_text" href="#"&gt;Link 1&lt;/a&gt;&lt;/p&gt;
                        &lt;p&gt;&lt;a class="mid_dropdown_text" href="#"&gt;Link 2&lt;/a&gt;&lt;/p&gt;
                        &lt;p&gt;&lt;a class="mid_dropdown_text" href="#"&gt;Link 3&lt;/a&gt;&lt;/p&gt;
                        &lt;/div&gt;
        &lt;/article&gt;
        &lt;header id="vehicle_3_header"&gt;
            &lt;h3 class="compare_sections_titles"&gt;Vehicle 3&lt;/h3&gt;
        &lt;/header&gt;       
            &lt;article id="right_section"&gt;
                &lt;button id="right_side_button"&gt;Make&lt;/button&gt;
                &lt;div id="right_side_dropdown_content"&gt;
                    &lt;p&gt;&lt;a href="#"&gt;Link 1&lt;/a&gt;&lt;/p&gt;
                    &lt;p&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/p&gt;
                    &lt;p&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/p&gt;
                &lt;/div&gt;
            &lt;/article&gt;
    &lt;/div&gt; 
    &lt;script type="text/javascript" src="Test3Javascript.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</p>