KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is it better / faster inside an event listener to use this or event.target I've been writing code like this (example is jQuery): jQuery('input').bind('keyup', function (e) { var j = jQuery(e.target); foo(j.attr('id') , j.val() ); }); And I was told to replace e.target with this because it's "better". Is there really any advantage to one or the other? I use target because it's a more general solution as it works for delegated events. I'm having trouble benchmarking because my tests get cluttered with the binding (Although, obviously, in this case the difference would be too small to matter anyway)
Tags (comma-separated)
Save Edits
Cancel