When setting the text in the search text box, the position jumps when leaving the focus Copy code The code is as follows://Search text box $("#txtSearch").focus(function () { if ($(this).val() == "Please enter the search keyword") { $(this).val(""); $(this).css("color", "black"); } }).blur(function () { if ($(this).val() == "") { $(this).css("color", "gray").val("Please enter the search keyword"); } }); Add in css Copy code The code is as follows:#txtSearch { width:480px; height:20px; vertical-align:middle; } |
<<: How to implement horizontal bar chart with percentage in echarts
>>: Teach you to quickly build a web cluster project based on nginx
Table of contents 1. Preparation 2. Decompression...
Table of contents 1. Retrieve via --skip-grant-ta...
This article shares with you the Ubuntu server ve...
Using CI to build docker images for release has g...
The tee command is mainly used to output to stand...
Table of contents introduce Installation and Usag...
Note: The system is Ubuntu 14.04LTS, a 32-bit ope...
Table of contents Diffing Algorithm Layer-by-laye...
In development projects, we can monitor SQL with ...
This article uses examples to illustrate the usag...
Table of contents 1. Setup 1. The first parameter...
Antd+react+webpack is often the standard combinat...
The solution is as follows: 1. Force delete conta...
This should be something that many people have do...
Table of contents Basic selectors: Level selector...