JavaScript How do I enable arrow navigation on keyboard for a list of Div using jQuery enable arrow navigation in excel,how to enable arrow navigation

I am following a tutorial [here][1] to make a Facebook like friend tagging system. But the tutorial lacks the "arrow navigating" capability like Facebook. I would like to figure out how to achieve this.

Basically, when I input text on the contenteditable area, it will generate divs of suggested friends like the following:

<div class="display_box">    
   <img src="user_img/John.jpg">
   <a target='_blank' href="#" class="addname" title="John">John</a><br>
   <span>India</span>
</div>
<div class="display_box">    
   <img src="user_img/Peter.jpg">
   <a target='_blank' href="#" class="addname" title="Peter">Peter</a><br>
   <span>USA</span>
</div>
<div class="display_box">    
   <img src="user_img/Mary.jpg>
   <a target='_blank' href="#" class="addname" title="Mary">Mary</a><br>
   <span>UK</span>
</div>

They are all divs with the class name display_box. I can click on the box and select them by:

$('div').on("click",".display_box",function(e) {
    // do the stuffs
}); 

I would like my users to be able to use the keyboard, using key up or key down to navigate between the selections, and use the enter key to trigger the selection. Any ideas how can I make this happen? Many thanks!

Answer:1

I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found ...

I am using Trisquel 7.0. I've some basic knowledge about html and JavaScript. Now I want to save html form data to file (Also interested in loading/filling html form from file). I searched and found ...

  1. saving html form data to text file
  2. saving html form data to xml
  3. saving html form data
  4. saving html form data to xml using javascript
  5. saving html form data to file
  6. saving html form data to xml using php
  7. html saving form values
  8. html form using php

Setup: leftItems & rightItems are arrays of 5 digit ID's. matchedItems is an array of all those ID's - there a lots of results with the same ID. $matches is a div to which I want to append results ...

Setup: leftItems & rightItems are arrays of 5 digit ID's. matchedItems is an array of all those ID's - there a lots of results with the same ID. $matches is a div to which I want to append results ...

I'm trying to display the time it takes a function to complete in javascript, and then display the time in an alert window that is called on button click, however the alert box doesn't pop up at all ...

I'm trying to display the time it takes a function to complete in javascript, and then display the time in an alert window that is called on button click, however the alert box doesn't pop up at all ...

  1. display http request
  2. display http request headers
  3. display http request online
  4. display http request java
  5. wireshark display http request
  6. tcpdump display http request
  7. chrome display http request
  8. php display http request
  9. tshark display http request
  10. firefox display http request
  11. wireshark display filter http request uri

I have a html table with a row that looks like: <tr> <td><input type="checkbox" name="check[]" value="265"></td> <td>265</td> <td>NO MATCH</...

I have a html table with a row that looks like: <tr> <td><input type="checkbox" name="check[]" value="265"></td> <td>265</td> <td>NO MATCH</...

  1. trigger bootstrap popover
  2. trigger bootstrap popover on hover
  3. bootstrap trigger popover manually
  4. bootstrap trigger popover with jquery
  5. bootstrap trigger popover javascript
  6. data-trigger popover bootstrap
  7. bootstrap popover trigger focus not working
  8. bootstrap popover trigger click and focus
  9. bootstrap popover trigger hover not working
  10. bootstrap popover trigger click
  11. bootstrap popover trigger hover and focus
  12. bootstrap popover trigger manual example
  13. bootstrap popover trigger focus
  14. bootstrap popover trigger click not working
  15. popover trigger bootstrap 4
  16. bootstrap popover trigger options
  17. bootstrap popover trigger close
  18. bootstrap popover trigger function
  19. popover trigger bootstrap 3
  20. bootstrap popover trigger programmatically