我使用了下面的代码jQuery("#change").submit(function() {
jQuery.each(jQuery('input[type=password]'),function(index,value){//我需要获取密码输入字段的值进行验证
});
return false;});
我还在表单中使用了三个密码输入字段
请任何人帮助我如何在jquery的每个函数中获取值?
发布于 2012-07-19 15:25:28
$('input[type=password]').each(function(){
alert($(this).val());
});发布于 2012-07-19 15:26:47
$('input[type=password]').each(function(i,item){ alert( $(item).val() ) })发布于 2012-07-19 15:31:18
只需像下面这样修改您的代码
$('input[type=password]').each(function(index,value)
{
// Here value(parameter) is an object
alert(value.value);
});https://stackoverflow.com/questions/11555797
复制相似问题