CSS+input input box delete text effect js code
js code
<script type="text/javascript">
document.getElementById("search").addEventListener("keyup",function(){
if(this.value.length>0)
{
document.getElementById("cls").style.visibility="visible";
document.getElementById("cls").onclick=function()
{
document.getElementById("search").value="";
}
}else
{
document.getElementById("cls").style.visibility="hidden";
}
});
</script>
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
16 May 2016
When the content of the input text box changes, we can use onchange or onblur to judge, but onchange occurs when the text content changes and then loses focus. Onblur occurs when the focus is lost, and it will not be judged by itself.
16 May 2016
Adding text content to a table is very common in practical applications. The following is a brief introduction to the specific implementation process. Interested friends can refer to the following
16 May 2016
In order to improve user experience and ease of use, some designers will optimize things that users frequently use on web pages, such as input boxes. How are general input boxes optimized? From the perspective of user experience, simplifying the user steps and making it more convenient for users improves usability.
16 May 2016
This article mainly introduces the input content codes of three types of js restricted text boxes. Friends in need can refer to it.
16 May 2016
Click on a cell to turn it into a text box for easy editing and testing
09 Sep 2023
How to skillfully use CSS3 special effects to improve the user experience of web pages. With the development of the Internet, web design and user experience have become important links in website development. The application of CSS3 special effects can add dynamics and visual effects to web pages and improve user experience. This article will introduce several common CSS3 special effects and their code examples to help developers become more proficient in using CSS3 special effects and improve the user experience of web pages. Transition effect (Transition) Transition effect is one of the most basic special effects in CSS3. By changing a certain attribute
22 Mar 2018
This time I will bring you the implementation of CSS3 visual special effects. What are the precautions for realizing CSS3 visual special effects? The following is a practical case, let’s take a look.
16 May 2016
jQuery and CSS3 are definitely used a lot for web front-end development. Next, I will share some special effects made by jQuery and CSS3. I hope it will be helpful to friends who like to learn special effects.
14 Mar 2018
This time I will show you how to use css3 to achieve 3D stereoscopic special effects. What are the precautions for using css3 to achieve 3D stereoscopic special effects? The following is a practical case, let’s take a look.
Hot Tools
CSS text is combined into a heart-shaped animation special effect
CSS text is combined into a heart-shaped animation special effect
CSS3 SVG expression flower animation special effects
SS3 SVG confession flower animation special effect is a Valentine's Day animation special effect.
CSS shopping mall websites commonly use left category drop-down navigation menu code
CSS shopping mall websites commonly use left category drop-down navigation menu code
jQuery+CSS3 Valentine's Day love special effects
jQuery+CSS3 Valentine's Day Love Special Effect is a Valentine's Day hanging swinging heart animation special effect.
css3 spoon scooping up glutinous rice balls animation special effects
A bowl of cute glutinous rice balls expression, a spoon scooping up a glutinous rice balls animation special effects