Menu ▼

Posted By :
Total Views : 2457

Clear all textbox value in the page using jQuery

This example shows you how to clear all textbox values in a page using jQuery. jQuery selector $("input:text") will select all the textboxes in the current document and $("input:text").val("") will clear all the textbox value.



Text1 :

Text2 :

Text3 :

Source Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Login Page</title>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        function cleartextboxes() {
        Text1 :
        <input type="text" value="Hello" />
        <br />
        <br />
        Text2 :
        <input type="text" value="Example" />
        <br />
        <br />
        Text3 :
        <input type="text" value="jQuery examples" />
        <br />
        <br />
        <input type="button" value="Clear" onclick="cleartextboxes();" />

comments powered by Disqus