From d1f59bc91e8439b92c20d5bdc7562c641cc6973c Mon Sep 17 00:00:00 2001 From: Martin Potier Date: Sun, 20 Sep 2015 15:48:57 +0200 Subject: [PATCH] Give focus to the input field immediately --- cherche.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cherche.js b/cherche.js index 870cf83..1e99277 100644 --- a/cherche.js +++ b/cherche.js @@ -220,6 +220,12 @@ function main() { var currentSelection = 0; //console.log(cisp.data); //console.log(words.data); + $( "#question" ).focus(); + + $( "#question" ).click(function (e) { + $( "#question" ).val(""); + }); + $( "#question" ).keyup(function (e) { var str = removeDiacritics($( "#question" ).val()); var cleanstr = str ? str.trim() : null;