<script type="text/javascript">
        $(document).ready(function () {
            $("#a").focus(function () {
                $(this).attr("value", "");
                $(this).attr("type", "password");
            });
        });
    </script>
<input type="text" name="a" id="a" value="aaa">
$(this).attr("value", "")是执行了没错
但是
$(this).attr("type", "password")被无视了