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

118
Views
Can you cancel the 'Checked' HTML property for a radio button using JavaScript?

Is it possible to cancel the checked HTML property for a radio button using JavaScript?

I have this layout:

<div class="wss_final_delivery">
  <div class="wss_final_delivery_wrap">Would you like to accept final delivery
    <label>
      <input type="radio" name="wss_accept_delivery" value="yes">
        Yes
    </label>
    <label>
      <input type="radio" name="wss_accept_delivery" value="no" checked="">
        No
    </label>
  </div>
</div>

This results in the "No" option to be checked by default. I would like none of the options to be checked by default and let the user choose his option. However, I can not change the HTML code. Is it possible to achieve using JavaSricpt?

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

0

You can do it using javascript, like this:

 document.querySelectorAll("[name='wss_accept_delivery']").forEach(radio=> {
  radio.checked = false;
  radio.removeAttribute('checked')
 });
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!