Javascript gets the sample code for the form elements in the form

  • 2020-03-30 01:45:45
  • OfStack

// gets the form object

Var form = document. GetElementById (' my_form ');

// username input object user_name is the name attribute of the object

Var userName = form. User_name;

// username is cleared

The userName. Value = ' ';

// user password the input object password is the name attribute of the object

Var password = form. The password;

// clear user password

Password. The value = ";


Related articles: