To receive the response from a web server, you can use the responseText or responseXML property of the XMLHttpRequest object. In this article, we are going to look at the responseText in more detail.

HTML Example

Syntax

responseText Property

If the response you receive from the web server is not XML, then use the responseText property. The responseText property returns the response as a string.