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

163
Vistas
jQuery Insert .after() is inserting as a string not HTML

I have my element selected like so

let btn = $("a[translate='server.ipmi.kvm.LAUNCH']")[0];

Then when attempting to insert after it i'm doing the following

btn.after('<a class="btn btn-default" onclick="launchNewKvm()">New KVM</a>')

This is inserting the content as a string for some reason and not as a button as I'd like, If I wrap this as a jQuery element then it inserts as [object Object]

any ideas at all would be appreciated

Inspect Element after running the .after

almost 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Here you use after method of javascript, not jquery, which if you need to insert an HTML, it should be a DOM Node or it will be treated as text.

If you want to use jquery after method, then don't get the index

let btn = $("a[translate='server.ipmi.kvm.LAUNCH']");

btn.after('<a class="btn btn-default" onclick="launchNewKvm()">New KVM</a>')
almost 4 years ago · Santiago Trujillo 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