How do I enter a value into input with autocomplete = "off"?

  • 0
    There is an input
    <input type="tel" id="card" autocomplete="off" class="form-control">

    How to inject a value into it using js?
    JavaScript Sebastian Carr, Dec 19, 2019

  • 3 Answers
  • 0
    In the console, run:

    document.querySelector('#card').value = 'Вставляемый текст';
    Anonymous

  • 0
    What's the problem then? This attribute does not restrict you in any way to use js.



    document.getElementById('card').value = 'Ваше значение'
    Anonymous

  • 0
    I'm sorry, I figured it out, looked inattentively, there was an iframe and this form in it. Thanks a lot to those who helped me!
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!