document .getElementById("select") .addEventListener("keydown", function(e) { if (e.key === "Enter" || (e.keyCode || e.which) === 13) e.open(); });