Sometimes passwordField.setAttribute(“value”,”newValue”) doesn’t work on my password field. But passwordField.value = “newValue” always works.
moreover, setAttribute is working fine on Mac platform but sometimes doesn’t work on win platform
Why is this happening ?
Forget about attributes for HTML elements in JavaScript. There are issues in IE, they don’t do exactly what you think and are unnecessarily verbose. The
valueproperty does exactly what you need and works correctly in all scriptable browsers.