I have this code:
<PlaceHolder> <div class="greenDiv"> <asp:TextBox ID="a" runat="server" /> </div> <div class="greenDiv"> <asp:TextBox ID="ab" runat="server" /> </div> </PlaceHolder>
I need to tell the user if he left the text box empty, I tried something like this .. (does not work) What did I miss?
$('.greenDiv > input:text').blur(function () { if (!$(this).val()) { alert("fill this field"); } });
source share