So i am facing a weird issue. A part of my javascript code which is a function is not working but when i put breakpoints and click the file after going to sources in chrome, the breakpoint starts working and my Javascript function runs perfect.(I can see the output.) Here is my code. Please tell why i am facing this issue?
HTML code.....
<textarea type="text" class="input-content" onchange="count(this)"></textarea>
<p class="character-count"></p>
Javascript
function count(char){
char.onkeyup = function () {
var text_max = 99;
var text_length = this.value.length;
var text_remaining = text_max - text_length;
char.parentNode.getElementsByClassName("character-count")[0].innerHTML = "Character count:" + text_length + "/" + text_max;
}
}