.attr(): type property can't be changed

.attr(): type property can't be changed

I am trying to change input type from password to text but I am getting the error in the subject.

  1. $('#password').attr("type", "text")
This is strange because this fiddle seems to be working:

Stackoverflow didn't help to clarify:

Any ideas?