,我需要选择一些项目,并检查是否值不为空,并隐藏previus项目....但没有工作....JQUERY如何选择项目
例如:
<script>
if($('input[type=text],input[type=email],input[type=password]').val() != ""){
$(this). prev().hide();
}
</script>
<div class="prova"></div>
<input type="text">
<div class="prova"></div>
<input type="text">
<div class="prova"></div>
<input type="text">
当我加载页面previus div为每个输入,而不是隐藏....有人可以帮助我吗?
如果您的主要要求是设置不是OP的元素的值,那么这种方法更好。 – ShankarSangoli 2012-02-10 02:03:59