JavaScript function that checks if textarea scroll has been moved

3

How to do a JavaScript function that verifies that the scroll of a textarea (this textarea has a responsibility term) has been moved.

If the user moves the scroll, enable a div with the continuation of a registration form.

Follow the code:

<script>
document.getElementById('id').onscroll = function(){
   alert('foi movido');
}
</script>
    
asked by anonymous 04.06.2014 / 16:30

1 answer

6

In pure Javascript

window.onload=function(){
    document.getElementById('id').onscroll = function(){
       alert('foi movido');
    }
}

Or you can also use this command from jQuery - .scroll

$("#id").scroll(function() { alert('Foi movido') });
    
04.06.2014 / 16:38