How would i find the xml node that has a certain text value?
example i want to do something like this which is not working:
var xml = "<data><itemB>more data</itemB><itemC>yes, more data</itemC><itemA>some data</itemA></data>";
var searchString = "more data";
var foundin = $(xml + ":contains(" + searchString + ")");
You can invoke the :contains selector with the root XML element as its context:
var foundin = $(":contains(" + searchString + ")", xml);
You can see the results in this fiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With