Within my JavaScript function, I am utilizing the following code to extract data from an XML file:
var title = $(this).children('Title').text();
This snippet of code successfully retrieves the content under the <Title> tags:
<Title>
Nice long title
</Title>
However, in the same XML document, there is additional information nested within the <ProductSearch> tag like so:
<ProductSearch>
<Products totalResultsAvailable="0" firstResultPosition="1" totalResultsReturned="0" searchOperator="or"/>
</ProductSearch>
I am now seeking assistance with obtaining the integer value for totalResultsAvailable. What code should I implement to achieve this? Your help is greatly appreciated.