简体   繁体   中英

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

How do I find the attributes of an HTML that is coming from ajax call?

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')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM