how to get a certain data value returned from a get Ajax request using jquery?
Example of the content of level_1_File
<p data-test_name="level_1"> Level 1 test results have passed </p>
This is the jquery code to get the data attribute of test_name but not working. No alert message is being displayed.
$.get(level_1_File, function(data)
{
if($(data).data("test_name") === "level_1")
{
alert($(this).text());
}
});
$(data) in condition but $(this) in alert.