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

微博輸入框練習(xí)

原創(chuàng) 2019-04-01 22:40:32 219
摘要:<!doctype html><html><head><meta charset="utf-8"><style type="text/css">.box{width:600px; height:170px; border:8px solid #FD4E4E; margin:0px auto;padd

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<style type="text/css">

.box{width:600px; height:170px; border:8px solid #FD4E4E; margin:0px auto;padding:6px;}

.box1 { float:right;color:#666}

img{float:left;}

input{border:0px; background-color:#FA7E3D;width:60px; height:22px;border-radius:2px;}

#text{width:595px; height:100px;margin: 5px 0px;}

</style>

<script type="text/javascript">

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

 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("你輸入過多字,不可以發(fā)布")

  text.focus()

 }else{

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

 }

 }

 

 aa()

 

 

 }

</script>


</head>


<body>

<div class="box">

<img src="01.png">

<div class="box1"> 你可以輸入<span id="number"> </span>字&nbsp;&nbsp;&nbsp;&nbsp;</div>

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

<img src="02.png">

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

</div>

</div>





</body>

</html>


批改老師:西門大官人批改時間:2019-04-02 11:16:46
老師總結(jié):作業(yè)完成的不錯,最好上傳一下程序的運行效果圖。

發(fā)佈手記

熱門詞條