clear input textbox value on load

Posted by user544079 on Stack Overflow See other posts from Stack Overflow or by user544079
Published on 2012-10-16T16:55:22Z Indexed on 2012/10/16 17:00 UTC
Read the original article Hit count: 211

Filed under:
|

I have the following form which is getting pre populated with values on load. I want to have empty input boxes on load using Javascript. However I do not have access to the <body> tag so <body onload="" will not work here. Is there any other way to clear the form fields on load?

<form method="POST" action="">
  <input name="username" id="user" value="" /><br />
  <input name="pwd" id="pass" value="" />
  <input type="submit" value="Go" />
</form>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dom