aşağıdaki kodları modernize edip web siteniz'de kullanabilirsiniz. Dilerseniz bu şekilde de kullanabilirsiniz. Forum'da konu başlığı ve içeriği sınırlaması için kullanımı çok uygundur diye düşünüyorum. Ayrıca türkçe karakterleri de normal karakter sayacak fakat özel karakter olarak'da sayacaktır.
Lütfen konu amacı dışında yorum yapmayınız. Sadece arayanların veya ihtiyacı olanların işleri görülsün diye atıyorum.


<!DOCTYPE html> <html> <head> </head> <body> <textarea id="text-input"></textarea> <p>Harf Sayısı (tr dahil): <span id="letter-count"></span></p> <p>Kelime Sayısı: <span id="word-count"></span></p> <p>Boşluk Sayısı: <span id="space-count"></span></p> <p>Özel Karakter Sayısı: <span id="special-count"></span></p> <button id="clear-button">Temizle</button> </body> </html> <!-- Stil kodları --> <style type="text/css"> body { font-family:quicksand; } textarea { width: 98%; height: 150px; margin-bottom: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px; padding: 10px; } button { background-color: #4caf50; border: none; color: white; padding: 10px 20px; font-size: 16px; border-radius: 4px; cursor: pointer; } button:hover { background-color: #3e8e41; } .count { margin-bottom: 10px; font-size: 16px; } </style> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function() { const textInput = document.getElementById("text-input"); const letterCount = document.getElementById("letter-count"); const wordCount = document.getElementById("word-count"); const spaceCount = document.getElementById("space-count"); const specialCount = document.getElementById("special-count"); const clearButton = document.getElementById("clear-button"); textInput.addEventListener("input", updateCounts); clearButton.addEventListener("click", clear); function updateCounts() { const text = textInput.value; letterCount.textContent = text.replace(/[^a-z,ı,ş,i,ü,ğ,ö,ç]/gi, "").length; const words = text.split(/\s+/); wordCount.textContent = words.length; const spaces = text.split(" "); spaceCount.textContent = spaces.length - 1; specialCount.textContent = text.replace(/[\w\s]/g, "").length; } function clear() { textInput.value = ""; updateCounts(); } }); </script>
