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

235
Views
How to correct javascript button's redirect?

I'am trying to add some js to my page, I create from it's a button and the aim of creating it is to redirect to another page but it is not working. Can you help me to solve it?

The situation is: the button is visible on my front-end (.jsp in Java EE), but there is no redirect. No matter what I write in URL simply no action is being made form click.

    buttonAbort.innerHTML = 'Anuluj';
    buttonAbort.style.cssFloat = 'left';
    buttonAbort.style.width = '70px';
    buttonAbort.style.height = '30px';
    buttonAbort.style.backgroundColor = 'red';
    button.setAttribute("id","buttonAbort");

    let buttonAbortById = document.getElementById("buttonAbort");
    buttonAbortById.onclick = function href() {
        location.href="/projekt/edytujStatus";
    }

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You most likely have a mistake in your code.

You probably want to do

buttonAbort.setAttribute("id","buttonAbort");

instead of

button.setAttribute("id","buttonAbort");
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!