First: Copy code The code is as follows:<input type="text" onkeydown="this.onkeyup();" onkeyup="this.size=(this.value.length>4?this.value.length:4);" size="4"> Among them, size="4" defines the initial size. If it is not defined here, change the 4 in this.size=(this.value.length>4?this.value.length:4); to 20. The default size of <input type="text"> is 20. second: If you define the width attribute in style, and want its width to change according to the content, aren't the two requirements contradictory? So here you can't define the width attribute in style. |
<<: SQL implementation of LeetCode (181. Employees earn more than managers)
>>: Vue+SSM realizes the preview effect of picture upload
Table of contents 1. In project development, the ...
Today, after the game was restarted, I found that...
This article uses examples to describe common bas...
Table of contents 1. writable: writable 2. enumer...
Table of contents 1. Install and import 2. Define...
If a form field in a form is set to disabled, the ...
/***************** * proc file system************...
Table of contents question 1. Install webpack web...
Table of contents Conditional compilation Page La...
Disk quota is the storage limit of a specified di...
<br />A year ago, there were no articles abo...
1. Varnish Overview 1. Introduction to Varnish Va...
1. Use basic text elements to mark up content Fir...
Table of contents Preface 1. Install NJS module M...
1. Who is tomcat? 2. What can tomcat do? Tomcat i...