[英]fetch data using class inside iframe and div using html, java script asp
I have an iframe and inside this there is a class called service-row and inside this div there is another class named service-cell 我有一个iframe,在其中有一个名为service-row的类,在此div中有另一个名为service-cell的类
I want to get the data from that class how to do that. 我想从该类中获取数据该怎么做。 And there are 40 items with same name class how to get that data.
并且有40个具有相同名称类别的项目如何获取该数据。
example 例
HTML page
<iframe id="iframe1">
<div class="servicesTab">
<div class="service-row">
<div class="service-cell">
Obstetrics(this data)
</div>
</div>
</div>
</iframe>
If you need data of specific cell then you can use the following code: 如果需要特定单元格的数据,则可以使用以下代码:
$("#iframe1 .service-cell:eq(0)").text()
else you can access all the cells using below code and then, iterate using for loop : 否则,您可以使用以下代码访问所有单元格,然后使用for循环进行迭代:
$("#iframe1 .service-cell")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.