I'm trying to return html page throught ajax response, the response return html codes of the page if I alert. I want to read the inner html of those html codes to get and values / contents. How can I achieve that if ajax request succeed. Thanks in advance.
// ajax
let req = $.ajax({
url: '/page',
method: 'GET',
dataType: 'html'
});
req.done(function(response){
// console.log(response)
// $(response).find('title').html();
// $(response).find('.my-header').html();
alert(response);
});
//html response
<head>
<title>my pagename</title>
</head>
<body>
<div class="my-header">HEADER TEXT</div>
</body>