$(data).find(“某些标签”)不起作用

have this code:

$.post("auth.php", {pass : pass}, function(data) {
        var x = $(data).find("span#c");
        $("div#addform").show();
        menu.html(data);
        console.log(data);
        console.log(x);
        alert(x);

and php:

if($ath['mail'] != $pass){ echo "<center> try another pass )</center>";} else {
    // print all db
    echo("<span id=\"c\">OK</span><br>");
    $sql = "SELECT * FROM user";
    $result=mysql_query($sql);

in response gets text/html but in console i get just "[]" and [object Object] if do alert(x) all data loads perfect in menu.html(data); but why i can't get my 'x' span what i'm doing wrong?

.find is to find the children; the span is not a child.

Try using .filter instead of .find.

find searches children of the jQuery element, but in your code, data is the <span>. It doesn't have any children.