if(password.length < 6){
alert(1);
}
document.getElementById('password').value = ''
<input type="password" autocomplete="off">
autocomplete HTML5
This attribute indicates whether the value of the control can be automatically completed by the browser. This attribute is ignored if the value of the type attribute is hidden, password, checkbox, radio, file, or a button type (button, submit, reset, image). Possible values are:
off: The user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.
on: The browser can automatically complete the value based on values that the user has entered during previous uses.