The content of common input text box is automatically vertically centered and the default prompt text is empty

Time:2021-1-12

Three functions:

1. Content auto vertical center
2. The default prompt text is grayed out
3. Click and it becomes empty

Copy code

The code is as follows:

<input type=”text” name=”wd1″ maxlength=”100″ style=” color:gray;width :199px; height:30px;line-height : 30px; “autocomplete =” off “value =” please enter the enterprise name “style =” color:gray; ” onfocus=”j avascript:if ( this.value ==’please enter enterprise name’) this.value = ”; this.style.color= ‘gray’;” onblur=”if( this.value == ”) { this.value =’please enter the enterprise name’; this.style.color = ‘gray’;}”>

Recommended Today

General method of Tkinter (21) components

method explain after(delay_ms, callback=None, *args) At least delay_ Ms after calling callback, no callback, equivalent time.sleep (); returns an ID to cancel after_ The cancel () method uses after_cancel(id) Cancel the callback of after method call after_idle(func, *args) Similar to the after method, but called when there is no event idle bell() A beep bind(sequence=None, […]