<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <label for="txt">姓名:</label>
    <input >
    <span ></span>
</body>
<script type="text/javascript">
    var txt=document.getElementById("txt");
    txt.onfocus=function(){
        //友好提示
        var span=document.getElementById("action");
        span.innerHTML="用户格式最小8位";
        span.style.color="#0f0";
    };
    txt.onblur=function(){
        var span=document.getElementById("action");
        span.innerHTML="对不起,格式不正确";
        span.style.color="#f00";
    }
</script>
</html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2022-02-19
  • 2022-12-23
  • 2022-02-12
  • 2021-12-14
猜你喜欢
  • 2021-12-25
  • 2021-12-18
  • 2022-02-27
  • 2022-12-23
  • 2021-11-27
相关资源
相似解决方案