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

154
Views
How do I detect the event when tab on an input?

How do I detect the event when tapping on an input?

I have a form where I have 5 inputs. I need to add a ccs class that changes the color of the label when the user changes from one input to another by tab

const InputGroup = function () {
  const greating = function (e) {
    console.log(e.target.value);
    console.log("only clicked");
  };
  return (
    <div className="input-group-with-icons">
      <label htmlFor="name" className="form-label">
        Name:
      </label>
      <div className="input-group">
        <span className="input-group-text iconify" id="basic-addon1" data-icon="carbon:string-text" data-width="50" data-height="50"></span>
        <input type="text" className="form-control" placeholder="Name" aria-label="name" aria-describedby="basic-addon1" name="name" onClick={greating} />
      </div>
    </div>
  );
};
export default InputGroup;

I can't find a way to detect the tab event

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the focus event to detect focus in Javascript:

<input type="text" onfocus={focusinhandler} onfocusout={focusouthandler} />

If your goal is to changing styling, you can use the :focus selector in CSS:

.input-group-text.iconify:focus {
    // Colour Change
}

which is applied when an element gains focus.

about 4 years ago · Juan Pablo Isaza Report
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!