简体   繁体   English

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

[英]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? 如何找到来自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')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Ajax调用后无法从div请求数据。 我该如何解决? - Can't request data from div after ajax call. How do I fix this? 当内容通过AJAX传输时,如何从html()中提取给定DIV的HTML() - How to extract HTML() of a given DIV from html() when content is coming through AJAX 如何解析从AJAX调用返回的HTML - How can I parse HTML returned from AJAX call 从某些不同的页面链接返回时,如何编译html内容? - How can I compile my html content when coming back from some different page links? 我如何使用 jQuery.html() 传递变量和一些 HTML - How can i pass a variable and some HTML using jQuery .html() 如何在javascript变量内向html代码添加属性? - How can I add attributes to html code inside of a javascript variable? Javascript object 不存储来自 HTML 的数据 - Javascript object not storing data coming from HTML 我无法从AJAX调用中捕获特定浏览器记录的错误。 抓住这些可能吗? - I can't catch specific browser logged errors from an AJAX call. Is catching these even possible? 烧瓶-我可以在AJAX调用过程中执行另一个请求。 - Flask - Can i perform another request in the middle of an AJAX call. 我正在尝试通过AJAX调用返回创建一个结果数组。 我怎么做? - I'm trying to create an array of results from my return on an AJAX call. How do I do that?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM