亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

微博留言字數輸入限制

Original 2018-12-25 22:06:32 552
abstrakt:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>微博留言</title><style>*{margin:0;padding:0;}.box{width: 600px;height: 200px;margin:0 auto;borde

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>微博留言</title>

<style>

*{margin:0;padding:0;}

.box{width: 600px;height: 200px;margin:0 auto;border:5px solid pink;border-radius: 5px;padding: 10px}

.top img{float: left;}

.top p{display: block;width: 50%;float: right;text-align: right;font-size: 12px;line-height: 24px;color:#888}

.top span{font-size: 16px;font-weight: bold;}

#text{width: 100%;height: 145px;border-radius: 5px;margin-top:5px;border-color:#ccc;}

#sp1,#sp2,#sp3,#sp4,#sp5,#sp6{float: left;width: 50px;text-align: right;height: 24px;line-height: 24px;font-size: 12px;margin-left: 5px}

#sp1{background: url(images/an5.png) no-repeat left center;}

#sp2{background: url(images/an4.png) no-repeat left center;}

#sp3{background: url(images/an3.png) no-repeat left center;}

#sp4{background: url(images/an2.png) no-repeat left center;}

#sp5{background: url(images/an1.png) no-repeat left center;width: 60px;}

#sp6{margin-right: 15px}

.button{float: right;}

#button{border: none;height: 24px;background: #ffc09f;color:white;width: 60px;border-radius: 3px}

</style>

<script>

var text,number,m

window.onload=function(){

text=document.getElementById('text')

number=document.getElementById('number')

button=document.getElementById('button')

text.onkeyup=function aa(){

m=140-text.value.length

if(m<0){

number.style.color="red"

}else{

number.style.color="#888"

}

number.innerHTML=m

}

button.onclick=function(){

if(m==140){

alert("你還沒有輸入!");

text.focus()

}else if(m>130){

alert("字數少于10,不可發(fā)布!")

text.focus()

}else if(m<0){

alert("字數太多,不可發(fā)布!")

text.focus()

}else{

alert("發(fā)布成功!")

}

}

aa()

}

</script>

</head>

<body>

<div>

<div>

<img src="images/12.png" alt="">

<p>還可輸入<span id="number"></span>字</p>

</div>

<textarea id="text"></textarea>

<span id="sp1">表情</span>

<span id="sp2">圖片</span>

<span id="sp3">視屏</span>

<span id="sp4">話題</span>

<span id="sp5">長微博</span>

<div>

<span id="sp6">公開</span>

<input type="button" value="發(fā)布" id="button">

</div>

</div>

</body>

</html>


Korrigierender Lehrer:滅絕師太Korrekturzeit:2018-12-26 09:20:58
Zusammenfassung des Lehrers:源碼跟老師源代碼一摸一樣啊,不應該,aa()這個函數不需要函數名,老師語法錯誤,你也跟著,下次不要這樣了,代碼要有自己的思路

Versionshinweise

Beliebte Eintr?ge