cheykawebdesign
New Member
I'm brushing up on my JS, and I don't know how to ask this, exactly. I have this:\[code\]text_area.onkeyup = function() { var text_length = this.value.length; var text_remaining = text_max - text_length; feed_back.innerHTML = "<strong>" + text_remaining + "</strong> charactres remaining";} \[/code\]It works. However, should I be able to take the function and pull it out to something like this?\[code\]function countDown() { var text_length = this.value.length; var text_remaining = text_max - text_length; feed_back.innerHTML = "<strong>" + text_remaining + "</strong> charactres remaining";}\[/code\]and just call the function by its name?\[code\]text_area.onkeyup = countDown();\[/code\]This has never worked for me, across multiple projects. Should it? Why doesn't it?