Javascript textarea scrollTop

javascript

I'm trying to enable checkbox once the user reads all the agreement. Yet, well, I've tried googling with no avail and also confused. I'm trying to get the "real" end of scrollTop, but due to different rendering engines (gecko, webkit, blah blah? ) a fixed value won't work.

This is part of my learning so please avoid posting solutions with libraries.

Any suggestions?

Best Answer

You can try using scrollHeight property of the textarea and compare it to scrollTop - if they're equal the user is at the very bottom.