Skip to content
Advertisement

How to obtain the body response in the client-side?

I am new in web, I am serving an html when a button is clicked on the client side through a request, the body response of that request is the html. How can I retrieve the html or body response from the client side?

I am trying with this code but everything is empty:

JavaScript

Any idea on how to obtain the body response in the client-side?

Advertisement

Answer

Try to add a div or any input element with the id “demo” and try to run the code below.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement