jQuery .find() on data from .ajax() call is returning “[object Object]” instead of div

前端 未结 17 1298
一生所求
一生所求 2020-12-07 22:05

Trying to find div element with id=\"result\" in returned data from .ajax() using .find(). Unfortunately, alert(res

17条回答
  •  遥遥无期
    2020-12-07 23:02

    You can do it in this way to find any div and get its attributes or anything you want.

    $(response).filter('#elementtobefindinresponse').attr("id");
    

    or

    $(response).filter('img#test').attr("src");
    

提交回复
热议问题