How to hide div class when filling a textbox
4 answers
User jQuery's
blur function.
<script>
$(function(){
$("[name=t1]").blur(function(){
if ($(this).val() == '') {
$(".loadData").hide();
}
});
})
</script>
Explanation:
You are calling the function on the blur
textbox event .
This means that the user has filled in the text box and wants to keep the text box.
In this function body, hide the div with the class loadData
.
+1
source to share