Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

71
Views
I'm trying to create a function that shows the content only when in the prompt confirm is clicked

i'm trying to create a function that shows the site content only when after reading the prompt, the user clicks on ok or confirm. This is what i got so far. I'm using VueCLI for this! This are the errors i got: 10:1 error 'add' is not defined no-undef 14:9 error Move function declaration to function body root no-inner-declarations 14:18 error 'remove' is defined but never used no-unused-vars

Main.js:

import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
    render: h => h(App),
}).$mount('#app')

function validation() {
    var site = prompt("some text");
    if (site == true) {
        function remove() {
            var element = document.getElementById("app");
            element.classList.remove("none");
        }
    } else if (site == false) {
        var response = document.getElementById("response");
        response.innerHTML = "some text";
    }
}

App.vue:

<template>
  <div class="none" id="app">
    <h1 id="response"></h1>
    <HeaderComp/>
    <MainComp/>
    <FooterComp/>
  </div>
</template>

scss:

<style lang="scss">
@import "bootstrap/dist/css/bootstrap.min.css";

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.none{
  display: none;
}

</style>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!