I am trying to write a javascript function to extend the R shiny action button demo. I would like the user to be able to enter a number by both clicking the action button an
I was able to figure this out using the jQuery is(":focus") function, the code I used was:
is(":focus")
$(document).keyup(function(event) { if ($("#number").is(":focus") && (event.key == "Enter")) { $("#goButton").click(); } });