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

141
Views
Elementor JavaScript change image when Accordion clicked

[solved, view working code below] I am trying to change an img src when an Accordion item is selected in elementor. The code I currently have would appear to me as being correct, but it's not working. Probably an obvious fix. It's important not to use JQuery.

my Accordion has 3 "tabs" with an img next to the widget, each tab has an ID #part1 #part2 #part3. And the img has an ID "img_swap".

Javascript code sample for 1 image (now working)

    <script>

document.getElementById("part1").onmousedown = function () {
  
  
    document.getElementById("img_swap").getElementsByTagName("img")[0].src="some_image";

};

    </script>
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

solved

    <script>

document.getElementById("part1").onmousedown = function () {
  
  
    document.getElementById("img_swap").getElementsByTagName("img")[0].src="some_image";

};

    </script>
about 4 years ago · Santiago Gelvez 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!