I had found this code on the internet somewhere a while ago to decrease the number depending on how many values have been inputted, i am not good with JavaScript at all and will be learning about it more soon.
But i just need an explanation of what the JS function does row by row.
function numberOfCharacters(textbox,limit,indicatore){
chars = document.getElementById(textbox) .value.length;
document.getElementById(indicatore).innerHTML = limit-chars;
}
<textarea rows="4" maxLength="255" onkeyup="numberOfCharacters('mytextbox',255,'characterLimit');" name="contact_message" id="mytextbox" placeholder="Message (255 Characters)"required></textarea>
<div class="chars">
<span id="characterLimit">255</span>
</div>
.