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

208
Views
If radio button selected, scroll up to the first line of radio

I have a long list of radio buttons. I am looking for a solution if a radio button is selected, the page scrolls to the beginning of the radio button.

Detail:

I have list of radio button like that:

<div class="form-check">
  <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1">
  <label class="form-check-label" for="flexRadioDefault1">
    Default radio
  </label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2" checked>
  <label id="divtwo" onclick="myMenu()" class="form-check-label" for="flexRadioDefault2">
    Default checked radio
  </label>
</div>

Js file:

function myMenu() { document.getElementById("divFirst").scrollIntoView(); }

I am looking for a solution, if the user clicks on the first radio button, then the page scrolls to the beginning. It does not scroll while I click, although I added onclick.

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

0

onclick="myMenu()" should be on checkbox not on Label:

<input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2" onclick="myMenu()">
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!