$( input ).attr( "type", "text" ) : 
不支持 attr   type 
改成  $("<input>", { "type": "button" })    试试

解决方案 »

  1.   


    $( s.el ).bind( s.ev, function() {
                "password" == $("<input>", { "type": "button" }) ?
                    $("<input>", { "type": "text" }) :
                    $("<input>", { "type": "password" }) :
            });
    我改成这样IE11也不行了,请问哪里错了!
      

  2.   

    1.9以上的是 $( input ).prop( "type" )替代了attr
      

  3.   

    ie 下不要通过js去修改表单元素的type属性,而应该直接指定表单元素的type属性
      

  4.   


    $( s.el ).bind( s.ev, function() {
                "password" == $("<input>", { "type": "button" }) ?
                    $("<input>", { "type": "text" }) :
                    $("<input>", { "type": "password" }) :
            });
    我改成这样IE11也不行了,请问哪里错了!
    你得使用上面的 $(this) 就是 Input  ,,,,写的是个使用方法,不是让你直接粘贴...
      

  5.   


    这层楼说的对  其他的误人子弟——!    你要想完成密码框和默认显示框的切换 需要两个input   一个type=text 提示"请输入密码"另一个 type=password 。 当点击第一个后  第一个隐藏 第二个显示     
      

  6.   

    ie 下不能修改表单元素的type属性,只能创建个新的表单元素,去替换掉旧的