i need to select some items and check if value are not empty, and hide the previus item….but not work….
for example:
<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">
when i load page the previus div for every input, not hide….someone can help me?
You can do it by passing a function to
.val().