Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

69
Views
submit/click on the action button with the enter button on the keyboard if the cursor doesn't focus on the text box

I made the following code with javascript to be able to submit/click on the action button with the enter button on the keyboard. But it will be a problem if I have some form input, or date input and don't know whether the cursor of the user is focused on the specific form or not.

$(document).keyup(function(event) {
if ($("#form1").is(":focus") && (event.keyCode == 13)) {
        $("#button1").click();
    }
});

Can it be changed to focus on a specific page instead of focusing on a specific form input?

Thankyou

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!