focus password element from password to ********


Hits: 1264  

/**
*  <form>
*  <input type=”text” name=”password” value=”Password” onfocus=”get_password_focus(this)”>
*  </form>
*  This function can be used for focus password element from password to ********
*/

function password_focus(obj)
{
var newO=document.createElement(‘input’);
newO.setAttribute(‘type’,’password’);
newO.setAttribute(‘name’,obj.getAttribute(‘name’));
obj.parentNode.replaceChild(newO,obj);
newO.focus();
}

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch