I've never thought about changing the type of an input element, except for password field (click the 👁️ eye button and you can see the password). Also it used to not work on older Internet Explorer but whatever...
But what about accessibility? Isn't this trick going to be confusing?
The easiest thing would be to try this out with a screen reader, which would be the most likely to get confusing in this case. I assume it would not be bad so long as the prompt is clear, and focus is managed properly.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.