我想知道如何使用jquery遍历隐藏字段来获取它们的值。隐藏的字段在php while循环中。
发布于 2011-01-24 17:47:42
$('input:hidden').each(function() {
var value = $(this).val();
// do something with the value
});发布于 2011-01-24 17:48:18
它不会使隐藏的字段在php循环中创建。
你可以像这样循环:
$("input[type='hidden']").each(function() {
alert($(this).val());
});发布于 2011-01-24 17:49:37
试试这个..。
$('input[type=hidden]').each(function(){
var hiddenValue = $(this).val();
});https://stackoverflow.com/questions/4780544
复制相似问题