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

116
Views
Disable input field autofill (pure JS)

Does anyone know how to disable input autofill/autocomplete in 2021 using pure JS?

I've tried:

<input type="password" autocomplete="off" />
<input type="password" autofill="off" />
<input type="password" autocomplete="new-password" />
<input type="password" autofill="none" />

etc.

Also tried using jquery.disable-autofill and npm disableautofill from the stackoverflow solutions

Gonna be good if someone can share some more solutions

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

0

one more thing we can use autocomplete in form tag also like see below

<form action="/form/submit" method="get" autocomplete="off">

Or In JS

    $(function() {
      setTimeout(function() {
        $("input").val("");
      }, 500);
   });
about 4 years ago · Juan Pablo Isaza Report

0

Try This Solution in JS

clearAutoFIll();

function clearAutoFIll(){
  var inp = document.querySelectorAll("[autocomplete=off] input");
  for(var x=0; x < inp.length; x++){
    inp[x].value = "";
  }
}
<form autocomplete=off>
  <input type=text name="phone" />
</form>

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!