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

107
Views
toggleAttribute not supported in IE

I have a situation where when a user selects a checkbox it is supposed to disable an input field. I wrote the following code that works wonderfully in all other browsers except IE which I didn't know was most important for the client.

let input = document.querySelector("input");
let button = document.querySelector(".checkbox");

button.addEventListener("click", function() {
    input.toggleAttribute("disabled");
});

Can someone help me with something that will also work in IE? Much appreciated.

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

0

For IE you need to use setAttribute and removeAttribute since toggle is not supported.

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!