我这样做倒底哪错了
农夫三锤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>