Description: Parses a string into an XML document.
data
a well-formed XML string to be parsed
jQuery.parseXML
uses the native parsing function of the browser to create a valid XML Document. This document can then be passed to jQuery
to create a typical jQuery object that can be traversed and manipulated.
Create a jQuery object using an XML string and obtain the value of the title node.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Demo:
<title>jQuery.parseXML demo</title>
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<p id="anotherElement"></p>
var xml = "<rss version='2.0'><channel><title>RSS Title</title></channel></rss>",
xmlDoc = $.parseXML( xml ),
$title = $xml.find( "title" );
$( "#someElement" ).append( $title.text() );
$title.text( "XML Title" );
$( "#anotherElement" ).append( $title.text() );
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3