How to extract parent text from an ajax return data?
I have the following html data being returned from the ajax request
<div> Log information from the following sessions
<span class="comments"> your comments </span>
<div>
<div>Section B log information
<span class="comments"> section B comments </span>
</div>
Here is my attempt to remove all comment classes from this return ajax request but not working and that the comments are not being removed.
$.ajax{
url: pathToFile
success: function(data)
{
var removeComments = $(data).remove(".comments");
alert(removeComments).html());
}
}