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

微博輸入字?jǐn)?shù)功能實(shí)例

Original 2019-02-16 20:15:57 300
abstrakt:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>微博輸入</title><link href="http://netdna.bootstrapcdn.com/font-awesome/4.

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>微博輸入</title>

<link href="http://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<style>

.box{width:500px;height:190px;margin:10px auto;border: 5px solid #0080c0;}

.box p{margin: 0;}

.box .lt{padding: 8px 10px;float: left;font-size: 16px;color:#1B7FB6;}

.box .rt{padding: 8px 10px;float: right;font-size: 14px;}

#text{width: 485px;height: 100px;float: left;margin: 0px 5px;resize:none;border: 1px solid #ccc;}

.huati{height:20px;float: left;margin:10px 0px;}

.huati #sp1,#sp2,#sp3,#sp4,#sp5{float: left;font-size: 14px;color: #201a1a;text-decoration: none;}

.huati i{margin:2px 3px 0px 5px;float: left;}

.butt{float: right;}

#bt{background: darkorange;color: #fff; width:80px;height:30px;line-height: 30px;text-decoration: none; margin:5px;text-align: center;border-radius: 3px;border: none;}

</style>

<script>

var text,num,m

window.onload=function(){

text = document.getElementById('text')

num = document.getElementById('num')

bt = document.getElementById('bt')

text.onkeyup=function wb(){

m = 140-text.value.length

if(m<0){

num.style.color="red"

}else{

num.style.color="#888"

}

num.innerHTML= m

}

bt.onclick=function(){

if(m==140){

alert("發(fā)布內(nèi)容不能為空!")

text.focus()

}else if(m<0){

alert("字?jǐn)?shù)過多請調(diào)整!")

}else{

text.focus()

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

}

}

wb()

}

</script>

</head>

<body>

<div class="box">

<p class="lt">有什么新鮮事想告訴大家?</p>

<p class="rt">還可以輸入 <span id="num"></span>字</p>

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

<div class="huati">

<i class="fa fa-meh-o" style="color:darkorange;"></i><span id="sp1">表情</span>

<i class="fa fa-picture-o"style="color:#008000;"></i><span id="sp2">圖片</span>

<i class="fa fa-video-camera"style="color:#0080ff;"></i><span id="sp3">視頻</span>

<i class="fa fa-hashtag"style="color:#0080ff;"></i><span id="sp4">話題</span>

<i class="fa fa-bolt"style="color:#f60;"></i><span id="sp5">頭條文章</span>

</div>

<div class="butt">

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

</div>

</div>

</body>

</html>


Korrigierender Lehrer:西門大官人Korrekturzeit:2019-02-17 09:20:32
Zusammenfassung des Lehrers:作業(yè)寫的不錯(cuò),以后寫代碼最好加上分號(hào)“;”

Versionshinweise

Beliebte Eintr?ge