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

371
Views
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 answers
Answer question

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 Report

0

Simply you can use jquery on your project and :

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

0

in your case:

document.getElementById("anid").innerText;

and add the id to your element

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