Clear asp.net control in page using Jquery



<script>
    $(document).ready(function () {
       $("#btnSubmit").click(function () {
          
          //Clear All textboxes
           $('input[type=text]').each(function () {
            $(this).val('');
          
           //Clear All Dropdowns and Listboxes
            $("select").each(function () {
             $(this).val('0');
            });

           //Clear Checkbox and Checkbox list Selection    
           $('input:checkbox').removeAttr('checked');

          //Clear Radio and Radiobutton list Selection
          $('input:radio').removeAttr('checked');
                })
            });
        });
    </script>

No comments: