javascript - How to change the HTML input type attribute from 'password' to' text'? -


i change html 'input' element 'type' attribute, type="password" type="text".

i aware easier find element id not every page has same id password input. how target password inputs , change inner value type of text.

i have few lines of javascript code:

a=document.getelementsbytagname("input");  a.setattribute(type,text); 

to convert elements of type password text:

var arr = document.getelementsbytagname("input"); (var = 0; < arr.length; i++) {     if (arr[i].type == 'password') arr[i].setattribute('type','text'); } 

note: not browsers allow dynamic changes type attribute on inputs.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -