Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

372
Visualizações
How can i get the text of a span element using javascript?

Edited for tags and further explanation of the question

Hello ,i am fairly new to the web programming, sorry in advance if this sounds out of place. My question is, i need to get customer's name and number from this <span class="tag-element-content" title="${Customer No}">${Customer Name}-${Customer No}</span> area, which is inside the code below, any help would be very appreciated.

<div class="tagger" id="ChoosenCustomer">
                                        <div class="tags-container tag-view focused" id="branches">
                                            <div class="tag-element-container" dojoattachpoint="_tagsContainer">
                                                <div class="tag-decorated-element" name="ChoosenTags" id="" is-clicked="true">
                                                    <span class="tag-element-content" title="${Customer No}">${Customer Name}-${Customer No}</span>
                                                    <span id="RemoveCustomer" class="tag-element-delete icon-cross" search-id="" click=DeleteCustomer()></span>
                                                    <input type="hidden" id="" value="${Customer No}" is-clicked="true">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

try this:

let span_text = document.querySelector('.your-element-class').textContent;

with jQuery:

let span_text = $('.your-element-class').text();
about 4 years ago · Juan Pablo Isaza Relatório

0

Simply you can use jquery on your project and :

var SpanText = $('.tag-element-content').text();
about 4 years ago · Juan Pablo Isaza Relatório

0

in your case:

document.getElementById("anid").innerText;

and add the id to your element

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda