W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
以下示例顯示實現(xiàn)字符計數(shù)器控件。將長度設(shè)置為輸入文本或文本區(qū)域可激活此控件。
materialize_charactercounter.html
<html> <head> <title>The Materialize DatePicker Example</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> </head> <body class="container"> <div class="row"> <form class="col s12"> <div class="row"> <div class="input-field col s6"> <input id="name" type="text" length="10"> <label for="name">Enter Name</label> </div> </div> <div class="row"> <div class="input-field col s6"> <textarea id="comments" class="materialize-textarea" length="120"></textarea> <label for="comments">Comments</label> </div> </div> </form> </div> </body> </html>
驗證結(jié)果,如下圖所示。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: