[html] autocomplete ='off' is not working when the input type is password and make the input field above it to enable autocomplete

When I faced the same problem, I came across two methods to solve it.

  1. Using javascript
  2. Using html (by creating a temporary text box above the password field and hide it)

Example using javascript

<input onfocus="this.type='password'" onblur="if (this.value.length <= 0) { this.type = 'text' } else { }" id="password"/>

Example using html (by creating a temporary text box just above the password field and hide it)

  <input type="text" style="display:none;">
  <input id="password" type="password">