Determine object that triggered callback?
I have several text fields that I want to callback to a common function to process them on change. I can't find how to determine WHICH of these text fields triggered the callback, so that I can update the database with the value.
My code looks something like this:
function updateTextField( e ) {
valueToUpdate = e.value;
// But which textField did it come from?
}
var myTF = makeTextField({ ... });
myTF.addEventListener( 'change', updateTextField );
Is there an attribute that I'm missing that will tell me this, or should I use an anonymous function for each of the multitude of text fields?
2 Answers
-
e.source
-
what name?
can you explain more?
you can sete.source.value