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

112
Views
Javascript: Input type radio

How can I select input type radio by just clicking the space around it?

enter image description here

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

You could use a <label> tag:

<input type="radio" name="box" id="box">
<label for="box">Your content here</label>

Clicking on the label toggles the input.

about 4 years ago · Santiago Gelvez Report

0

You should be using the label element. There are two ways to use it with a radio button, as shown below.

<form>
  <label>
    <input type="radio" name="options">
    <span>Option 1 - Inside Label</span>
  </label>

  <br>

  <input type="radio" name="options" id="button2">
  <label for="button2">
    <span>Option 2 - Outside Label</span>
  </label>
</form>

about 4 years ago · Santiago Gelvez 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!