Home JS special effects CSS3 special effects CSS+input input box delete text effect js code

CSS+input input box delete text effect js code

CSS+input input box delete text effect js code

CSS+input input box delete text effect js code

A simple input input box delete text effect js code, imitating Baidu click delete search box input text 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>
Disclaimer

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

js code to capture input text box content change event_form effects js code to capture input text box content change event_form effects

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.

Add the text input box content to the js code in the table_javascript skills Add the text input box content to the js code in the table_javascript skills

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

Js creates the effect of the default text disappearing when the input box is clicked_Text special effects Js creates the effect of the default text disappearing when the input box is clicked_Text special effects

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.

js restricts the input content of the text box code sharing (category 3)_javascript skills js restricts the input content of the text box code sharing (category 3)_javascript skills

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.

js realizes the effect code of double-clicking a cell into a text input box_javascript skills js realizes the effect code of double-clicking a cell into a text input box_javascript skills

16 May 2016

Click on a cell to turn it into a text box for easy editing and testing

How to skillfully use CSS3 special effects to improve the user experience of web pages How to skillfully use CSS3 special effects to improve the user experience of web pages

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

Implementation of css3 visual effects Implementation of css3 visual effects

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.

Sharing of 7 eye-catching jQuery/CSS3 special effects examples_jquery Sharing of 7 eye-catching jQuery/CSS3 special effects examples_jquery

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.

How to use css3 to achieve 3D stereoscopic effects How to use css3 to achieve 3D stereoscopic 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.

See all articles See all articles

Hot Tools

CSS text is combined into a heart-shaped animation special effect

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

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

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 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

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