开发者

Get First Hidden Field

开发者 https://www.devze.com 2023-01-17 02:02 出处:网络
I have the following code: $(document.body).click(function() { $(\".content\").each(function(i) { 开发者_运维知识库 $(this).

I have the following code:

    $(document.body).click(function() {
       $(".content").each(function(i) {
          开发者_运维知识库 $(this).
       });
    });

How can I retrieve the value of the first hidden field within $(this)?


You can use :hidden and :first filter selectors like this:

$(document.body).click(function() {
   $(".content").each(function(i) {
       $(':hidden:first', $(this)).val();
   });
});
0

精彩评论

暂无评论...
验证码 换一张
取 消