如何在里面获取值。每个函数 [英] How to get values inside .each function

查看:89
本文介绍了如何在里面获取值。每个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用

Hi,
I am using

$('.Detailswhole').each(function () {
    }



用于获取循环内的值。



在Detailswhole类中,我有2个div,名为whole1和whole2。

在整个1中我有3个标签和相应的文本框,在整个2中我有1个标签和相应的文本框.Britnwhole类是通过追加创建的。

点击编辑按钮时的值将生成Detailswhole类。单击提交按钮,我需要将这些值显示为警告。



在我的每个函数中,我将得到计数,没有显示任何值我到目前为止尝试的是:


for getting values inside the loop.

In the Detailswhole class I have 2 div named whole1 and whole2.
In whole1 I have 3 labels and corresponding text boxes for that and in whole2 I have 1 label and corresponding text box. The Detailswhole class is created by appending.
On clicking an edit button the values in the Detailswhole class will be generated. On clicking the submit button I need to show these values as alert.

In my each function I will get the count no values are displayed. I have tried so far is:

$('.Detailswhole').each(function () {
EditTypeID = $('#lblTypeValue' + i).text();
alert(EditTypeID);
}



显示空白


It shows a blank

推荐答案

' 。Detailswhole')。each( function (){
}
('.Detailswhole').each(function () { }



用于获取循环中的值。



在Detailswhole类中,我有2个名为whole1的div whole2。

在整个1中我有3个标签和相应的文本框,在整个2中我有1个标签和相应的文本框.Britnwhole类是通过追加创建的。

单击编辑按钮时,将生成Detailswhole类中的值。单击提交按钮时,我需要将这些值显示为警报。



在我的每个函数中将得到计数没有显示任何值。我到目前为止尝试的是:


for getting values inside the loop.

In the Detailswhole class I have 2 div named whole1 and whole2.
In whole1 I have 3 labels and corresponding text boxes for that and in whole2 I have 1 label and corresponding text box. The Detailswhole class is created by appending.
On clicking an edit button the values in the Detailswhole class will be generated. On clicking the submit button I need to show these values as alert.

In my each function I will get the count no values are displayed. I have tried so far is:


' 。Detailswhole' )。each( function (){
EditTypeID =
('.Detailswhole').each(function () { EditTypeID =


' #lblTypeValue' + i).text();
alert(EditTypeID);
}
('#lblTypeValue' + i).text(); alert(EditTypeID); }



显示空白


It shows a blank


这篇关于如何在里面获取值。每个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆