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

258
Vistas
HTML <a> href that points to another <a> href

I have a hidden <a> tag with some id. It renders by script, so I don't have access to it. And I have my own <a> which is visible to user. I want to when user clicks my own <a> it redirects him with same href which script rendered <a> has.

I can't use <script> tag or js script files.

<a href="/somegerantedhred" id="someId" style="display: none"></a>

<a href="somehow get same href"></a>
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

If you can add some javascript into your element instead of the script, you may have some luck using onclick. Then target the hidden link, get it's href value, and use it to change the window location:

<a href="/somegerantedhred" id="someId" style="display: none"></a>

<a onclick="window.location.href = document.getElementById('someId').getAttribute('href')">Your button</a>

about 4 years ago · Juan Pablo Isaza Denunciar

0

Not having access to the tags or the js files makes it almost impossible, the best thing I could come up with would be to use CSS to unhide the generated anchor by using #someId {display:block!important} so that you can use that generated tag as your anchor, however, I am not sure if this generated tag already has a value, if it doesn't, then nothing will be displayed in the screen and without access to the DOM with JS, it is pretty hard to find a solution to this matter.

#someId {display:block!important}
<a href="/somegerantedhred" id="someId" style="display: none">The hidden content</a>

<a href="somehow get same href">Your content</a>

about 4 years ago · Juan Pablo Isaza Denunciar

0

If you can use onclick, then just put this in your source:

<a href="/somegerantedhred" id="someId" style="display: none"></a>

<a onclick="window.location.href = document.getElementById('someId').href"></a>
about 4 years ago · Juan Pablo Isaza 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