How would I select the following in jQuery?
<ns:text value="my value" />
I have tried the snippets below, but to no avail. Is this possible?
var x= $('ns:text').attr('value');
return x;
var x= $('text').attr('value');
return x;
You're looking for:
var x= $('ns\\:text').attr('value');
return x;
Ref:
Take a look at JQuery, XML and namespaces.
It seems that this should work:
var x = $("ns\\:text").attr("value");
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