如何在jquery中从转发器获取div值

时间:2022-11-28 21:05:52

I have a code like

我有一个代码

<asp:Repeater ID="repBalanceSheet" runat="server">
 <HeaderTemplate>
 <div class="left">
 <div class="columns">
 <div class="column">
 <div class="left-cells r1 heading">Fiscal year ends in December</div>
 <div class="left-cells r2 bg heading">USD in Million except per share data</div>
 <div class="left-cells r3 l3 heading level1">Assets</div>
 <div class="left-cells r4 l4 heading level2">Current assets</div>
 </div>
 </div>
 </div>
 </HeaderTemplate>
 <ItemTemplate>
 <div class="<%# "column c" + Container.ItemIndex.ToString() %>">
 <div class="<%# "heading r1 second1 c" + Container.ItemIndex.ToString() %>">
 <%# FormatDate(Eval("ReportDate"))  %></div>
 <div class="<%# "bg r2 c" + Container.ItemIndex.ToString() %>"></div>
 <div class="<%# "right-cells r3 c" + Container.ItemIndex.ToString() %>"></div>
 <div class="<%# "right-cells r4 c" + Container.ItemIndex.ToString() %>"></div>
 </div>
 </ItemTemplate>
 </asp:Repeater>

now I want to access the repeater into Jquery can anyone please tell how to get the values of repeate in Jquery.

现在我想访问转发器到Jquery任何人都可以告诉如何在Jquery中获取重复的值。

1 个解决方案

#1


2  

You can try with this:

你可以尝试这个:

$('.heading.r1.second1.c').text();

Note:

Form elements can have values but div can contain text and forms, so if this is the case then you can use ".val()" to get the values.

表单元素可以包含值,但div可以包含文本和表单,因此如果是这种情况,则可以使用“.val()”来获取值。

#1


2  

You can try with this:

你可以尝试这个:

$('.heading.r1.second1.c').text();

Note:

Form elements can have values but div can contain text and forms, so if this is the case then you can use ".val()" to get the values.

表单元素可以包含值,但div可以包含文本和表单,因此如果是这种情况,则可以使用“.val()”来获取值。