Like the right-most icon in the input box, with the empty function

Source: Internet
Author: User

"Content-type"Content="text/html; Charset=utf-8"><title>insert title here</title><!--JS introduced--><script type="Text/javascript"Src=".. /js/jquery-1.10.2.js"></script><link href="Bootstrap.css"Rel="stylesheet"><style type="Text/css">. Round {/*Large span*/background: #fff None repeat scroll0 0;    border:1px solid #bbb; Display:inline-Block;    height:28px; Margin-right:2px; Vertical-Align:top;    width:175px; Position:relative;}. Delquery {/*Clear Icon*/background-position:0-320px;    Cursor:pointer;    height:20px; margin:4px 0px0 0;    Position:absolute; Right:0; Top:0; width:20px;}. Input_key {/*Input Box*/background: #fff None repeat scroll0 0; border:0none; Border-radius:0; FONT:16PX/22px Arial;    height:18px; margin:5px0 05px; Outline:0none; padding:0;    width:140px; Background-repeat:no-repeat;}</style>"text"/> </td> </tr> <tr> <td><spanclass="round"Id="suggest-align"> <input type="text"Autocomplete="off"Maxlength=" -"Value="" class="Input_key"tabindex="1"Name="Q"Id="keyword"> <span title="Clear" class="Delquery"Id="Clear"style="Display:none;">x</span></span> </td> </tr></table></body><script type="Text/javascript">$ (function () {$ ("#clear"). Click (function () {$ (". Input_key"). Val (""); $(". Input_key"). focus (); $( This). Hide ();})/*var tvalue;setinterval (function () {if (TValue!=$ ("#keyword"). Val ()) {//Here Write your own business logic code if ($ (". Input_key            "). Val (). Trim ()! =" ") {$ (" #clear "). Show ();       } tValue =$ ("#keyword"). Val (); }},100); */vartvalue;$ ("#keyword"). KeyDown (function () {if($(". Input_key"). Val (). Trim ()! ="") {              $("#clear"). Show (); }});$("#keyword"). KeyUp (function () {if($(". Input_key"). Val (). Trim ()! ="") {              $("#clear"). Show ();    }}); })</script>

Like the right-most icon in the input box, with the empty function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.