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
When learning Vue, when I always use webpack inst...
Table of contents 1. Direct assignment 2. Shallow...
1. Install MySQL This article is installed via AP...
After the green version of mysql5.6 is decompress...
This article shares the specific code of JavaScri...
As shown below: Copy the remote server's file...
MySQL 5.7.8 and later began to support a native J...
Redis uses the apline (Alps) image of Redis versi...
<div align="center"> <table sty...
Table of contents Install sakila Index Scan Sort ...
Apple Mug Icons and Extras HD StorageBox – add on...
Table of contents Get the content of the iframe o...
How to define complex components (class component...
Preface In the Linux operating system, device fil...
Preface: Timestamp fields are often used in MySQL...