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 When developing, analyzing the ...
Find the problem Today I encountered a problem of...
This article shares the specific steps of install...
#String concatenation concat(s1,s2); concatenate ...
Sometimes we save a lot of duplicate data in the ...
Table of contents 1. Overview 2. Parameters for c...
This article uses examples to illustrate the basi...
This article records the installation tutorial of...
How to find slow SQL statements in MySQL? This ma...
I won't say much nonsense, let's just loo...
Table of contents 1. Overview 1.1 Usage of queryS...
Preface In today's increasingly convenient In...
MySQL database is widely used, especially for JAV...
Table of contents question background Idea & ...
A simple record of the database startup problems ...