The input box handles the ability to delete small icons

Source: Internet
Author: User

/** * Search in the deletion of small icon function and press backspace key to delete the content when the event, for emptying the text in the search box; * inputID: Form ID name such as: Searchkeys*/_clearsearchinput:function (inputid) {if(typeofinputID! ="string") {            return; }        //input Focus        varInput_focus = $ ("#"+inputID); //Console.log (input_focus);        varCloseicon = Input_focus.parent (). Next (". Clear_icon"); varInput_timer; //search box processing;Input_focus.bind ("Blur", Function (e) {if(Input_timer) {clearinterval (Input_timer); }}). bind ("Focus", Function (e) {//alert ("a");                varthat = This; Input_timer=setinterval (function () {if(That.value = ="") {closeicon.hide (); }Else{closeicon.show (); }                },  $); }). bind ("KeyDown", Function (e) {e= e | | Window.Event; if(E.keycode = =8) {                    if( This. Value = ="") {closeicon.hide (); }                } Else {                    if( This. Value = ="") {closeicon.hide (); }Else{closeicon.show (); }}). bind (" Change", Function (e) {if($.trim (Input_focus.val ()). length >0) {closeicon.show ();        }        }); //small icon processing;Closeicon.bind ('Tap', Function (e) {Input_focus.focus ().Select(0,0); Input_focus.val (""); $( This). Hide (); });//if ($.trim (Input_focus.val ()). length>0) {//closeicon.show ();//        }},

The input box handles the ability to delete small icons

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.