Indonesia
<!-- http://www.downcodes.com/js --> <!-- bbs http://www.downcodes.com/bbs--> <!-- 完整的HTML代码 --> <html > <head> <style type="text/css"> .progress{ lebar: 1 piksel; tinggi: 14 piksel; warna: putih; ukuran font: 12px; meluap: tersembunyi; warna latar: biru tua; padding-kiri: 5px; } </style> <script type="text/JavaScript"> function textCounter(field,counter,maxlimit,linecounter) { // lebar teks// var fieldWidth = parseInt(field.offsetWidth); var charcnt = bidang.nilai.panjang; // potong teks tambahan if (charcnt > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { // persentase bilah kemajuan var persentase = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ; document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px"; document.getElementById(counter).innerHTML="Limit: "+percentage+"%" // koreksi warna pada gaya dari CCFFF -> CC0000 setcolor(document.getElementById(counter),percentage,"background-color"); } } fungsi setcolor(obj,persentase,prop){ obj.style[prop] = "rgb(80%,"+(100-persentase)+"%,"+(100-persentase)+"%)"; } </script> </head> <body> <form> <textarea row = "5" cols = "40" name = "maxcharfield" id = "maxcharfield" onKeyDown = "textCounter(ini,'progressbar1',20) " onKeyUp="textCounter(ini,'progressbar1',20)" onFocus="textCounter(ini,'progressbar1',20)" ></textarea><br /> <div id="progressbar1" class="progress" ></div> <script>textCounter(document.getElementById("maxcharfield"),"progressbar1",20)</script> </form> </body> </html> <br><br><br> <p><font color=red>//网站:http://www.downcodes.com</font></p>