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

完整版本的的一些總結(jié)

original 2019-03-01 18:13:09 165
abstrait:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>weibo1</title> <style type="text/css"> body{font-size:12px;} .box{width:600px;he

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>weibo1</title>

<style type="text/css">

body{font-size:12px;}

.box{width:600px;height:160px;border:10px solid pink;margin:0 auto;padding:10px;}

.box img{float:left;}

.box div{float:left;width:150px;height:24px;margin-left: 255px;text-align:center;line-height:24px;font-size:14px;color:#888}

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

    #text{width:600px;height:100px;border:1px solid #ccc;margin-top:5px;}

    #tu1,#tu2,#tu3,#tu4,#tu5,#tu6{float:left;width:30px;height:32px;font-size:14px;color:#888;padding-left:25px;line-height:32px;}

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

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

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

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

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

    #tu6{margin-left:150px;margin-right:15px;color:#888}

    #bt{border:none;border-radius:5px;width:75px;height:30px;float:left;background:#ffc09f;color:#fff;}

</style>

<script type="text/javascript">

var txt,num,number,fen

window.onload=function(){

      txt=document.getElementById('text')

      number=document.getElementById('zishu')

      txt.onkeyup=function ce(){

        num=txt.value

        fen=140-num.length

        if(fen<0){

             zishu.style.color="red"


        }else{

            zishu.style.color="blue"


        }


          zishu.innerHTML=fen


      }

      bt.onclick=function(){


      if(fen==140){


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

           text.focus()

   


     }else if(fen<0){


        alert("發(fā)布文字超過最大限制")

        text.focus()

     }else{


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

     }


      }

      ce()


}



</script>

</head>

<body>

<div class="box">

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

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

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

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

  <span id="tu2">文字</span>

  <span id="tu3">音樂</span>

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

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

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

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

  




</div>




</body>

</html>


我直接把獲取到的值給了fen這個變量,用它去比較,對于這一款慢慢熟悉了,就是很不是特別熟練,比如這個正則和判斷表單有點(diǎn)陌生,對于隱性參數(shù)感覺有點(diǎn)突然

Professeur correcteur:滅絕師太Temps de correction:2019-03-02 09:05:54
Résumé du professeur:完成的不錯!相同效果可以通過不同方法完成,作業(yè)可以跳出老師思維!

Notes de version

Entrées populaires