jQery $('#myPasswordField').attr('type', 'text'); OR javascript document.getElementById('myPasswordField').type = 'text';