Код:
<script type="text/javascript"> if ((document.URL.indexOf("viewtopic.php") != -1) || (document.URL.indexOf("post.php") != -1) || (document.URL.indexOf("edit.php") != -1)) { var repl = document.getElementById("main-reply"); var submit = document.getElementsByTagName("p") for (var i=0; i<submit.length; i++){ if (submit[i].className == "formsubmit") submit[i].innerHTML = "<span id=\"plng\" style=\"border: 1px solid; padding: 2px 3px;\">Написано символов: <b>0</b></span>" + submit[i].innerHTML; } repl.onkeyup = repl.onkeydown = repl.onfocus = repl.onblur = function(){ document.getElementById("plng").innerHTML ="Написано символов: <b>" + (repl.value.length) + "</b>"; }} </script>