Reputation: 23
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>
Upvotes: 0
Views: 253
Reputation: 178
Simply you can use jquery on your project and :
var SpanText = $('.tag-element-content').text();
Upvotes: 0
Reputation: 37
in your case:
document.getElementById("anid").innerText;
and add the id to your element
Upvotes: 0
Reputation: 165
try this:
let span_text = document.querySelector('.your-element-class').textContent;
with jQuery:
let span_text = $('.your-element-class').text();
Upvotes: 1