Modal-dialog does not wish to close again
<p>I use modals to load CKEditor in. It works, when I press a button the selected modal get's loaded. Then I press the next button to load the second modal. This also works fine, I can close it without a problem. But then, when I open the first one again, it does not want to close anymore... but I can't discover why. What is the problem?</p>

<pre><code>&lt;!-- The Modal --&gt;
        &lt;div id="myModalBesc" class="modal"&gt;
          &lt;!-- Modal content --&gt;
          &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
              &lt;span class="close"&gt;X&lt;/span&gt;
              &lt;h2&gt;Beschrijving:&lt;/h2&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                    &lt;br&gt;
                    &lt;textarea name='beschrijving' style='width: 400px;height:100px;'&gt;&lt;/textarea&gt;
                    &lt;br&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
              &lt;h3&gt;Klik op 'X' om te sluiten&lt;/h3&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;

&lt;!-- The Modal --&gt;
        &lt;div id="myModalSpec" class="modal"&gt;
          &lt;!-- Modal content --&gt;
          &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
              &lt;span class="close"&gt;X&lt;/span&gt;
              &lt;h2&gt;Specificaties:&lt;/h2&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                    &lt;br&gt;
                    &lt;textarea name='specificaties' style='width: 400px;height:100px;'&gt;&lt;/textarea&gt;
                    &lt;br&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
              &lt;h3&gt;Klik op 'X' om te sluiten&lt;/h3&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;

&lt;!-- Trigger/Open The Modal Beschrijving--&gt;
&lt;button id="myBtnBesc" onclick="ModalBesc();"&gt;Open WYSIWYG&lt;/button&gt;

&lt;!-- Trigger/Open The Modal Specificaties--&gt;
&lt;button id="myBtnSpec" onclick="ModalSpec();"&gt;Open WYSIWYG&lt;/button&gt;

&lt;script type="text/javascript"&gt;
        function ModalBesc() {
            CKEDITOR.replace( 'beschrijving' );
            var modal = document.getElementById('myModalBesc'); 
            var btn = document.getElementById("myBtnBesc");
            var span = document.getElementsByClassName("close")[0];

            btn.onclick = function() {    
                modal.style.display = "block";
            }

            span.onclick = function() {
                modal.style.display = "none";
            }

            window.onclick = function(event) {
                if (event.target == modal) {
                    modal.style.display = "none";
                }
            }
        }

        function ModalSpec() {
            CKEDITOR.replace( 'specificaties' );
            var modal = document.getElementById('myModalSpec'); 
            var btn = document.getElementById("myBtnSpec");
            var span = document.getElementsByClassName("close")[0];

            btn.onclick = function() {    
                modal.style.display = "block";
            }

            span.onclick = function() {
                modal.style.display = "none";
            }

            window.onclick = function(event) {
                if (event.target == modal) {
                    modal.style.display = "none";
                }
            }
        }
&lt;/script&gt;
</code></pre>

<p>Please help me out! Thanks in advance...</p>