Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how can do i open the select tag using keyboard event using javascript site:stackoverflow.com

document
  .getElementById("select")
  .addEventListener("keydown", function(e) {
    if (e.key === "Enter" || (e.keyCode || e.which) === 13)
      e.open();
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #open #select #tag #keyboard #event #javascript
ADD COMMENT
Topic
Name
8+1 =