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

微博輸入2-檢查字數(shù)

original 2019-03-09 14:55:52 287
abstrait:<!doctype html><html><head><meta charset="UTF-8"><title>微博輸入</title><style>body{font-size: 12px;}.box{width: 550px;height: 160px;border:7px solid pi

<!doctype html>

<html>

<head>

<meta charset="UTF-8">

<title>微博輸入</title>

<style>

body{font-size: 12px;}

.box{width: 550px;height: 160px;border:7px solid pink;margin: 20px auto;padding: 15px;}

img{float: left;width: 130px;height: 20px;margin-left: 20px;margin-top: 5px;}

.box1{float: left;width: 150px;height: 20px;font-size: 12px;line-height: 20px;margin-top: 8px;margin-left: 230px;}

#number{font-size: 14px;font-weight: bold;}

#text{width: 550px;height: 100px;padding: 5px;}

.box #sp1,#sp2,#sp3,#sp4,#sp5,#sp6{float: left;height: 

24px;line-height: 24px;padding: 2px 17px;margin-right: 0px;}

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

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

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

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

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

#sp6{margin-left: 125px;margin-right: 2px;color: #888;}

#anniu{color: #fff;border: none; border-radius: 5px;background: pink;width: 80;height: 26px;}

</style>

<script>

var text,number,m;

window.onload=function(){

text=document.getElementById("text");

number=document.getElementById('number');

anniu=document.getElementById("anniu");

text.onkeyup=function(){

m=140-text.value.length;

if (m<0) {

number.style.color="red";

}else{

number.style.color="#888";

}

number.innerHTML=m;

}

anniu.onclick=function(){

if (m==140) {

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

text.focus();

}else if(m<0 ){

alert("字數(shù)過得,不能發(fā)布。");

text.focus();

}else{

alert("發(fā)布成功。");

}

}


}

</script>

</head>

<body>

<div>

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

<div>你還可以輸入<span id="number"></span>個字</div>

<textarea name="" id="text" rows="10"></textarea>

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

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

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

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

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

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

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

</div>

</body>

</html>


Professeur correcteur:韋小寶Temps de correction:2019-03-09 15:15:03
Résumé du professeur:寫的還算是很不錯的 等有時間可以通過jQuery來改寫一下哦 還可以把jQuery練習(xí)練習(xí)

Notes de version

Entrées populaires