例子,jquery修改input标签type属性。
 
<style> 
.input_Login { 
width: 100px; 
height: 15px; 
border: 1px solid #C3D9FF; 
background: #ffffff; 
padding: 2px 0 0 3px; 
} 
.px { 
    -moz-border-bottom-colors: none; 
    -moz-border-image: none; 
    -moz-border-left-colors: none; 
    -moz-border-right-colors: none; 
    -moz-border-top-colors: none; 
} 
.vm { 
    vertical-align: middle; 
} 
.xg1 { 
    color: #999999 !important; 
} 
</style> 
密码:<input type="text" name="pwdPrompt" style='display:;height:22px;' type='text' class='input_Login px vm xg1'  value='请输入密码' /><input type="password" name="pwd" style='display:none;height:22px;' type='password' class='input_Login px vm xg1' /> 
    <script type="text/javascript"> 
   $("input[name=pwdPrompt]").focus(function () { 
  $("input[name=pwdPrompt]").hide(); 
  $("input[name=pwd]").show().focus();
   }); 
   $("input[name=pwd]").blur(function () { 
  
  if ($(this).val() == "") { 
 $("input[name=pwdPrompt]").show(); 
 $("input[name=pwd]").hide(); 
  } 
   }) 
</script>