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

108
Views
Agregar enlace href al elemento de texto

Estoy usando una API de terceros para mostrar un gráfico de gráficos altos. En este gráfico hay una sección de créditos que desde esta API de terceros no está redirigiendo a ningún lado. Debido a que es de un tercero, no tengo la capacidad de editar el código de Highcharts directamente. Me gustaría editar este elemento de texto para agregar un href para que al hacer clic en él se redirija a una página diferente. ¿Es esto posible a partir de un elemento de texto?

Estoy intentando convertir esto sin href:

 <text x="1190" class="highcharts-credits" text-anchor="end" data-z-index="8" style="cursor:pointer;color:#777770;font-size:9px;line-height:10px;font-family:roboto;font-weight:normal;text-shadow:false;fill:#777770;" y="275" aria-hidden="false">Example.com © Natural Earth</text>

en con href:

 <text x="10" class="highcharts-credits" text-anchor="start" data-z-index="8" style="cursor:pointer;color:#999999;font-size:9px;fill:#999999;" y="495"><title>Copyright (c) 2020 Highsoft AS, Based on data from Natural Earth</title>Example.com © <a href="http://www.naturalearthdata.com">Natural Earth</a></text>

Intenté lograr esto obteniendo la clase highcharts-credits y haciendo un evento onclick para redirigir a la página que espero aquí. Al hacer esto nada está cambiando.

Aquí está mi fragmento de código:

 let textChange = document.getElementsByClassName("highcharts-credits"); textChange.onclick = function () { location.href = "www.google.com"; };
 <text x="1190" class="highcharts-credits" text-anchor="end" data-z-index="8" style="cursor:pointer;color:#777770;font-size:9px;line-height:10px;font-family:roboto;font-weight:normal;text-shadow:false;fill:#777770;" y="275" aria-label="Chart credits: Source: IBISWorld, Advertising Agencies" aria-hidden="false">Example.com © Natural Earth</text>

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