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