Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could achieve this by 'listening' about what is pressed on the window, and then detecting the particular letter/string pressed, search through items list and if you find it change its css properties or add a new 'selected' class i.e. (demo => <a href="http://jsfiddle.net/steweb/mC6tn/" rel="nofollow">http://jsfiddle.net/steweb/mC6tn/</a> ..try pressing whatever :) and <strong>added</strong> after something found press left or right btns, or enter) : </p> <p><strong>JS</strong>: (supposing that each element you want to find something into and select it has class 'elem')</p> <pre><code>var whatYouAreSearching = $('&lt;div class="searching-string"&gt;&lt;/div&gt;'); //just to see what string you're typing $(document.body).append(whatYouAreSearching); function search(what){ what = what.toLowerCase(); $('.elem').removeClass('selected'); //reset everything $.each($('.elem'),function(index,el){ if($(el).html().toLowerCase().indexOf(what) &gt; -1){ $(el).addClass('selected'); return false; //found, 'break' the each loop } }); } var letterPressed = []; var timeOutResetLetters = null; $(window).keypress(function(e) { clearTimeout(timeOutResetLetters); //clear timeout, important! timeOutResetLetters = setTimeout(function(){ //if 500 ms of inactivity, reset array of letters pressed and searching string letterPressed = []; whatYouAreSearching.html(''); },500); letterPressed.push(String.fromCharCode(e.keyCode)); //look at the comment, thanks Niclas Sahlin whatYouAreSearching.html(letterPressed.join('')); //show string search(letterPressed.join('')); //and search string by 'joining' characters array }); </code></pre> <p><strong>EDIT</strong> added left/right/enter keys handling</p> <pre><code>$(window).keydown(function(e){ //left right handling var currSelected = $('.elem.selected'); if(e.keyCode == "37"){ //left, select prev if(currSelected.prev() &amp;&amp; currSelected.prev().hasClass('elem')){ currSelected.prev().addClass('selected'); currSelected.removeClass('selected'); } }else if(e.keyCode == "39"){ //right, select next if(currSelected.next() &amp;&amp; currSelected.next().hasClass('elem')){ currSelected.next().addClass('selected'); currSelected.removeClass('selected'); } }else if(e.keyCode == "13"){ //enter $('.entered').remove(); $(document.body).append(currSelected.clone().addClass('entered')); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload