asp.net - JQuery looping not working -
i working on jquery loop on textbox such whenever classname="xyz" needs put datetime control there else textbox needs work regular textbox have set validations. having trouble looping through using jquery .each. can let me know if missing something.
<script> $(".xyz").each(function () { if ($(this).hasclass('xyz')) { $(".xyz").datepicker(); }}) </script> <asp:textbox id="txt" runat="server" cssclass="xyz"></asp:textbox>
you don't need second class selector. inside loop targeting each element "xyz" class. use "this" keyword perform operation.
<script> $(".xyz").each(function () { $(this).datepicker(); }); </script> <asp:textbox id="txt" runat="server" cssclass="xyz"></asp:textbox>
Comments
Post a Comment