0

Here is contenteditable ,The border will become wider or narrower with the input value。enter image description here

How to make the 's border grow or shrink width the changing of the input value?

radiorz
  • 1,459
  • 4
  • 18
  • 36
  • Does this answer your question? [width:auto for fields](https://stackoverflow.com/questions/4622086/widthauto-for-input-fields) – Rani Giterman Apr 30 '22 at 09:41

1 Answers1

0

try something like this :

      <input
        type="text"
        oninput="this.style.width = this.value.length + 'ch' "
      />
radiorz
  • 1,459
  • 4
  • 18
  • 36