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

369
Views
How to solve Uncaught TypeError: Cannot read properties of undefined (reading 'toggle')

I would like to add a "-js-expanded" class to this element if someone hover over a tag. how can I do this?

<a href="" target="_self" class="sticky-cta" onmouseover="myFunction()" >
  <span class="sticky-label">GET STARTED</span>
  <i class="icon-features-productivity"></i>
</a>
  function myFunction () {
      this.classList.toggle("-js-expanded");
  }
  .-js-expanded {
  color: red;
  }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 function myFunction (element) {
      element.classList.toggle("-js-expanded");
  }
.-js-expanded {
  color: red;
  }
<a href="" target="_self" class="sticky-cta" onmouseover="myFunction(this)" >
  <span class="sticky-label">GET STARTED</span>
  <i class="icon-features-productivity"></i>
</a>

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!