Reputation: 2055
How get this text via each loop?
$('input[id^="ctl00_PlaceHolderMain_subElems2223_repSubElems_ct"]').each(function () { });
how get this value?
This not work
Important
If I will write this I will get this value but underlined part is all the time different
Upvotes: 1
Views: 163
Reputation: 1396
try this
$('[id*="hiddenSpanData"]').each(function () { });
Upvotes: 1
Reputation: 459
Try like this:
var spanText = $('this').next("span#content").text();
Upvotes: 2
Reputation: 115242
Parse the value content then get element using find()
$('input[id^="ctl00_PlaceHolderMain_subElems2223_repSubElems_ct"]').each(function () {
var text = $(this.value).find('span#content').text();
});
Upvotes: 1
Reputation: 148160
You are trying to get the span in html you have in input type hidden. So first get the html using .val() on hidden field. After that you can get the span. You can assign html to some div to find span in its descendants.
$('<div></div>').text($('input[id^="ctl00_PlaceHolderMain_subElems2223_repSubElems_ct"]')
.val()).find('span').eq(1).text();
Upvotes: 1