x是一个变量,存储来自AJAX调用的一些html.我如何提取HTML的属性

x is a variable storing some html coming from AJAX call. how can i extract the attributes of that HTML

本文关键字:html 提取 属性 HTML 何提取 变量 一个 存储 AJAX 调用      更新时间:2023-09-26

如何查找来自ajax调用的HTML的属性?

var x = table_row.find('td:nth-child(5)').html();  
var y = x.getAttribute("id");  // im doing this but this is not working

如果你想获得x对象id,你可以这样做var y = x.prop('id')