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

147
Views
How do I add the blank to the window.location function?

I am using this function to take a person to a page by clicking a button

   function newtoJs() {
        window.location=("page/page2/www/index.html");
    }

However, I want to open in a new window. How do I do that? These don’t work:

window.location=("page/page2/www/index.html" "target='_blank'");
window.location=("'page/page2/www/index.html' target='_blank'");
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Here's a code snippet based on clicking a button to create the interaction.

<a class="clickme">Example Button</a>

<script type="text/javascript">
    const el = document.querySelector('.clickme');
    el.addEventListener('click', function() {
        window.open('https://example.com', '_blank');
    });
</script>
about 4 years ago · Juan Pablo Isaza Report
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!