javascript – HTML / CSS / JS rubbery Input


Hi guys! Faced the following problem: You need to typeset a rubber input so that when typing, it stretches to fit the content and moves everything that is on the side (if it is in the text). Here is an example of a form, you need to do exactly the same: But as I looked Here the form is made through divs and it looks like all inputs are hidden and from divs value is transferred to inputs and then they are sent to the mail. Help with this, how to implement it?


document.querySelector('input').addEventListener('input', function () { = 0; = this.scrollWidth + 'px';
<input autofocus style=width:0>
Scroll to Top