This is often used on login forms, for example, to toggle the visibility of a password. The site will change the <input> element's type to "text" to allow the password to show.