返回我这样做倒底哪......登陆

我这样做倒底哪错了

农夫三锤2019-01-10 17:26:57252
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>blog</title>
  <style>
    .box{width: 800px;height: 200px;border: 10px solid purple; margin: 50px auto;padding: 20px;}
    .box1{float: left;margin-left: 255px;width: 200px;height: 25px;text-align: right;font-size: 20px;color: orange;}
   /* #text{width: 500px;height: 100px;border: 1px solid gray;margin-top: 6px;*/
     .box span {font-size: 18px;font-weight: bold;}
    }


  </style>
    <script>
     var text1,number,m
     window.onload=function(){
      text1=document.getElementByName('text1')
     number=document.getElementById('number')
     bt=document.getElementById('bt')
     text1.onkeyup=function zf(){
      m=140-text1.value.length
     if(m<0){
     	number.style.color='red'
     }else{
     	number.style.color='#ccc'
        }
        number.innerHTML=m
      }
     }
    </script>



</head>
<body>
   <div class="box">
<div class="box1">还可以输入<span id="number">字</span></div>
<textarea name="text1" id="text" cols="100" rows="10"></textarea><br>
<input type="button" value="发布">
   </div>
</body>
</html>



最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送