This commit is contained in:
Aevann1 2021-11-27 01:45:11 +02:00
parent 7068981bf2
commit e5ab485f10
6 changed files with 53 additions and 16 deletions

View file

@ -268,4 +268,28 @@ function markdown(first, second) {
}
document.getElementById(second).innerHTML = marked(input)
}
function charLimit(form, text) {
var input = document.getElementById(form);
var text = document.getElementById(text);
var length = input.value.length;
var maxLength = input.getAttribute("maxlength");
if (length >= maxLength) {
text.style.color = "#E53E3E";
}
else if (length >= maxLength * .72){
text.style.color = "#FFC107";
}
else {
text.style.color = "#A0AEC0";
}
text.innerText = length + ' / ' + maxLength;
}