Friday, 15 January 2021

jQuery - how to empty (clear) textbox

  

 

Watch this example on YouTube

 

 

   @Html.TextBoxFor(x=>x.or.Column3, new { @id = "myID"})
    <input type="submit" id="btnSubmit" value="Submit" />   
   
}


@section Scripts{
    <script type="text/javascript">

        $(document).ready(function () {
            $("#btnSubmit").click(function () {
                $("#myID").val('');
            });
            
        });

    </script>
    }

No comments:

Post a Comment