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. Custom import in packaging t...
Open the connection tool. I use MobaXterm_Persona...
Managing disk space is an important daily task fo...
Description of the situation: Today, I logged int...
Some attributes about elements In the daily devel...
Table of contents Achieve results Rolling load kn...
Original URL: http://segmentfault.com/blog/ciaocc/...
List style properties There are 2 types of lists ...
Step 1: Sign a third-party trusted SSL certificat...
Developers familiar with Element-UI may have had ...
Table of contents Overview Function signature Opt...
js date time format Convert the date and time to ...
<br />This tag can display a horizontal line...
This article shares the specific code of Vue.js t...
The META tag, commonly referred to as the tag, is...