1

How to pass event properties while triggering built in JavaScript events?

For: el.triggerHandler('mousedown'); how do I pass set event.which that is accessed inside the function?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
srrvnn
  • 609
  • 1
  • 11
  • 20
  • More specifically, I am running this inside a jasmine unit test case. Using `triggerHandler()` from AngularJS jqLite. – srrvnn Jul 30 '14 at 00:38
  • The jqLite documentations sez that [jqLite.on does not support the `selector` or `eventData` parameters](https://docs.angularjs.org/error/jqLite/onargs). – Jeff Sisson Jul 30 '14 at 02:33
  • Does that mean jQuery is necessary to perform visual interaction tests ? – srrvnn Jul 30 '14 at 16:40
  • You could use plain old javascript to [simulate a mousedown event](http://stackoverflow.com/a/4176116/2119660), which should trigger the proper handlers for mousedown – Jeff Sisson Jul 30 '14 at 20:28

0 Answers0