Home > Back-end >  Close popup page
Close popup page

Time:10-15

How do I close a popup page? The page opens, but I can close it without refreshing the page.

const chartDom = $("#main")
const seeResultsBtn = $("#seeResults");

function resultChatrs() {
  table.classList.add("invisible");
  title.classList.add("invisible");
  chartDom.classList.add("active");
}

seeResultsBtn.addEventListener("click", resultChatrs);
<button id="seeResults">See Results</button>

<div id="main"></div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

CodePudding user response:

You need to return all to their previous state, something like this:

const chartDom = $("#main")

const hideResultsBtn = $("#hideResults");

function hideResultChatrs() {
  table.classList.remove("invisible");
  title.classList.remove("invisible");
  chartDom.classList.remove("active");
}

hideResultsBtn.addEventListener("click", hideResultChatrs);

CodePudding user response:

Here it is

function resultChatrs() {
      table.classList.add("invisible");
      title.classList.add("invisible");
      chartDom.classList.add("active");
    }
  • Related