I have a succeed ajax request that can download the whole html contents, now I only need to get a div tag which contains id "data-today".
How to code such a script?
I have a succeed ajax request that can download the whole html contents, now I only need to get a div tag which contains id "data-today".
How to code such a script?
Take a look at this SOq:
Something along these lines:
success: function(data) {
//create jquery object from the response html
var $response=$(data);
//query the jq object for the values
var dataToday = $response.find('#data-today').text();
}
$('#data-today').html() if you want all the html // this out puts
if you want text inside it
$('#data-today').text() // this gives hello how are you
.text() gives the text in between html
<div> hello how are you </div>