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

微博輸入字?jǐn)?shù)

Original 2019-05-19 22:53:56 185
abstract:<!DOCTYPE html><html>             <head>             &nbs

<!DOCTYPE html>

<html>

             <head>

                         <meta charset="utf-8">

                         <script type="text/javascript" src="jquery-3.3.1.min.js"></script>

                         <link rel="stylesheet" type="text/css" href="static/font-awesome/css/font-awesome.min.css">

                         <title>微博輸入字?jǐn)?shù)</title>

                         <style type="text/css">

                         *{margin:0;padding:0;}

                         body{font-size:14px;}

                         .fl{float:left;}

                         .fr{float:right;}

                         .clear{clear:both;}

                         .blog{margin:30px auto;padding:10px;border:8px solid pink;width:500px;}

                         .title{width:100%;height:30px;line-height: 30px;}

                         .text{width:100%;height:100px;}

                         .bottom{margin:10px auto;}

                         .bottom span{margin-right:10px;}

                         .btn{width:70px;}

                         </style>

              </head>

             <body>

             <div class="blog">

                              <div class="title"><span class="fl">有什么新鮮事想告訴大家</span><span class="fr">還可以輸入<span id="num">200</span>字</span></div>

                              <div class="clear"></div>

                                 <div>

                                          <textarea class="text"></textarea>

                                 </div>

                                 <div class="bottom">

                                             <span><i class="fa fa-user" style="color:pink"></i> 表情</span>

                                             <span><i class="fa fa-image" style="color:red"></i> 圖片</span>

                                             <span><i class="fa fa-video-camera" style="color:blue"></i> 視頻</span>

                                             <span><i class="fa fa-coffee"></i> 話題</span>

                                             <span><i class="fa fa-keyboard-o"></i> 長微博</span>

                                             <span style="margin-left:70px">公開</span>

                                             <button class="fr btn" disabled="disabled">發(fā)布</button>

                                 </div>

                 </div>

             <script>

                         $(function(){

                                  $('.text').keyup(function(){

                                 $textlen=$(this).val().length;

                                 $stextlen=200-$textlen;

                                 $('#num').text($stextlen);

                                 $('.btn').removeAttr('disabled');

                                 console.log($textlen)

                                 if($textlen<=0){

                                         $s('.btn').attr('disabled','true');

                                         }

                             })

              })

             </script>

             </body>

</html>


Correcting teacher:天蓬老師Correction time:2019-05-20 09:31:36
Teacher's summary:jQuery的選擇器的使用很規(guī)范, 代碼也符合要求 , 但就是一行注釋沒有, 這樣的代碼可讀性,可維護(hù)性是不好的, 請加上注釋, 你現(xiàn)在能理解, 過上幾個(gè)月, 或者同事看, 會遇到麻煩的,是不是?

Release Notes

Popular Entries