<body>
    用   戶  名:<input type="text" name="oo" id="text" /><span id="rs"></span><br />
    密          碼:<input type="password" name="ii" id="psd" /><span id="rs1"></span><br />
    確認密碼:<input type="password" name="ii" id="repsd" /><br />
    <input type="text" name="pp" id="tt" /><br />
    <script type="text/javascript">
    var text = document.getElementById("text");
    text.onblur = function() {
         var rs = document.getElementById("rs");
         rs.innerHTML = "xxxxx";
         }
         var repsd = document.getElementById("repsd");
         repsd.onblur = function() {
            var psd = document.getElementById("psd");
            var s="密码不相同"
            var psd1 = psd.value;
            var repsd1 = this.value;
            var rs1 = document.getElementById("rs1");
            if (psd1 == repsd1) {
                s="密码相同";
            }
            rs1.innerHTML = s;
                          
     }
</script>
      
</body>