Javatpoint Logo
Javatpoint Logo

jQuery.isXMLDoc() method

The isXMLDoc() method returns a Boolean value and determines whether or not a DOM node is in the XML document or is itself an XML document. If it finds the passed value is an XML document or in the XML document, it returns true. Otherwise, it returns false.

Syntax

The commonly used syntax of this method is given below -

This method accepts a single parameter which is defined as follows -

node - It specifies the DOM node to check whether it is an XML document or in the XML document.

Example

It is a simple example of using the isXMLDoc() method. In this example, we are using the isXMLDoc() method to determine whether the passed values are in the XML document or itself an XML document. Here, we are passing different values as an argument.

Here, there are two variables, one is storing the XML, and another one is storing the simple string. We are also using the $.parseXML() and $.parseHTML() methods to parse the variables into XML and HTML files. Then we will pass the variables to the isXMLDoc() method to check the results.

Test it Now

Output

After the execution of the above code, the output will be -

jQuery.isXMLDoc() method





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA