Banner disappears when modal opens

  banner, html, javascript, modal-dialog

I am building a website and I started with a cookies banner. Afterwards I wanted to add a modal box for cookies policies, and I am using for it this template.
The problem is that when I click on the button of the modal box, part of the banner disappears.

<div class="cookie-consent-banner">
<div class="cookie-consent-banner__inner">
<div class="cookie-consent-banner__copy">
  <div class="cookie-consent-banner__header">THIS WEBSITE USES COOKIES</div>
  <div class="cookie-consent-banner__description"> For more info visit our <button class="mynewbutton" id="myBtn">cookies policy</button></div>


<div class="cookie-consent-banner__actions">
  <!--<a href="#" class="cookie-consent-banner__cta">
  <button id="i" class="cookie-consent-banner__cta">
  <script src=""></script>

    if (window.localStorage.getItem('accept_cookies')) {

  $("button").click(function() {
    window.localStorage.setItem('accept_cookies', true);



  <a href="" class="cookie-consent-banner__cta cookie-consent-banner__cta--secondary">



<!-- The Modal -->
<div id="myModal" class="modal">

<!-- Modal content -->
<div class="modal-content">
<span class="close">&times;</span>
<p>Some text in the Modal..</p>

// Get the modal
var modal = document.getElementById("myModal");

// Get the button that opens the modal
var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];

// When the user clicks the button, open the modal
 btn.onclick = function() { = "block";

// When the user clicks on <span> (x), close the modal
span.onclick = function() { = "none";

 // When the user clicks anywhere outside of the modal, close it
 window.onclick = function(event) {
 if ( == modal) { = "none";

How can I solve this problem? Thanks

Source: Ask Javascript Questions