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

153
Views
How to focus button in CSS class by JavaScript

I have problem, how to focus to CSS style by Jquery and JavaScript. I have this code:

   it('Add new group', () => {
        cy.waitForInitLoad();
        cy.get('#dxToolbarMenu').then(($el) => {
            
            expect($el[0].className).to.equal(
              'dx-item dx-menu-item dx-menu-item-has-text dx-menu-item-has-icon',
            )
          })

Original CSS from web is in this picture:

CSS from web page

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

0

You can do something like this:

cy.get('#dxToolbarMenu')
  .find('.dx-item.dx-menu-item.dx-menu-item-has-text.dx-menu-item-has-icon')

You can also add focus() to focus on the Element.

cy.get('#dxToolbarMenu')
  .find('.dx-item.dx-menu-item.dx-menu-item-has-text.dx-menu-item-has-icon')
  .first() //In case of multiple elements with the same selector consider take the first one
  .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!