Jquery reset form and erase fields - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Jquery reset form and erase fields

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.0.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from  ww w. ja va2 s  . c o  m
$("#contact_form input[name=c_name]").val('');
    });

      </script> 
 </head> 
 <body> 
  <form id="contact_form" name="form" method="post" action=""> 
   <input name="c_name" type="text" title="Insert Personal Name" value="name"> 
  </form> 
  <button>Clear</button>  
 </body>
</html>

Related Tutorials