Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda