Get First Hidden Field
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();
});
});
精彩评论