nonphoto nonphoto - 10 months ago 50
Javascript Question

Prevent input event from firing when changing textarea programmatically

I have a

that can be edited by the user. I occasionally update the text programmatically by changing the element's
property. I need an event that triggers when the user changes the text, but not when the program changes it. Is this possible?


use keyup as the event trigger which will allow the user activity to trigger the function but not if you do it programmatically

addEvent(document.getElementById('textArea_id'), 'keyup', function(event) {
//function goes here