Capture output value

Gold Contributor
Gold Contributor
If the html code would look like: Winkel I could easily capture the value of the span class via a jquery extensionand js code: jQuery(this).find('span').attr('class'). However how should I define the js code in order to capture the value 'Winkel' ? Tx Siegert
3 REPLIES 3

Capture output value

Tealium Employee
Hi Siegert, You can tweak what you already have so it reads: jQuery(this).find('span').text(); Adrian
Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Capture output value

Gold Contributor
Gold Contributor
Tx Adrian. Only 1 small issue here, but related to a specific case: In this case we have 2 lines: 1 with the term and 1 with the number of results. span class="term">Winkel span class="count">(277) With your code the output is: Winkel (277). How can I limit it to just capture the value where class=term ? tx

Capture output value

Gold Contributor
Gold Contributor
Go it: jQuery(this).find('span.term').text();
Public