abstract:微博输入 var text,number,m
window.onload=function(){
text=document.getElementById("text")
number=document.getElementById("number")
bt=document.getElementById("bt")
text.onkeyup=function aa(){
m=140-text.value.length//微博限制字数是140
if(m<0){
number.style.color="red"
}else{
number.style.color="#888"
}number.innerHTML=m
}
bt.onclick=function(){
if(m==140){
alert("您还没有输入")
text.focus()
}else if(m<0){
alert("字数过多,不能发布")
text.focus()
}else{
alert("发布成功")
}
}
aa()
}
还可输入字表情
图片
视频
话题
长微博
公开
Correcting teacher:灭绝师太Correction time:2018-11-16 11:21:43
Teacher's summary:光靠老师讲的案例,不可以奥,自己找点案例完成,不会就问