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

171
Vistas
How can one get this value of a span with jQuery?

If we have this span, how can I get the value of sip, i.e. john.doe@xyz.de

<span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10">
      <img name="imnmark" title="" showofflinepawn="1" class="ms-spimn-img ms-spimn-presence-disconnected-10x10x32" src="/_layouts/15/images/spimn.png?rev=23" alt="User Presence" sip="john.doe@xyz.de" id="imn_1,type=sip">;                  
 </span>

Right now I use

var projectLeaderName = $('#projectLeader span').html();

to get the entire value of the span, but I don't know how to get the value of sip with jQuery.

I don't think this screenshot is necessary, but I'll add it for completion:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use jQuery.attr to get the value of an attribute:

var projectLeaderName = $('span img').attr('sip');
console.log(projectLeaderName);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10">
      <img name="imnmark" title="" showofflinepawn="1" class="ms-spimn-img ms-spimn-presence-disconnected-10x10x32" src="/_layouts/15/images/spimn.png?rev=23" alt="User Presence" sip="john.doe@xyz.de" id="imn_1,type=sip">;                  
 </span>

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