Comments on: Dispatching an Event https://frontendmasters.com/blog/dispatching-an-event/ Helping Your Journey to Senior Developer Fri, 19 Jan 2024 00:16:40 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Alec https://frontendmasters.com/blog/dispatching-an-event/#comment-351 Thu, 18 Jan 2024 15:52:35 +0000 https://frontendmasters.com/blog/?p=540#comment-351 My thinking was just to put 0 in the span tag. Just don’t do anything clever like initialising the input with a value, OK?

]]>
By: Shum Stra https://frontendmasters.com/blog/dispatching-an-event/#comment-350 Thu, 18 Jan 2024 08:38:21 +0000 https://frontendmasters.com/blog/?p=540#comment-350 In this situation, we could also store the event listener as a constant and run it manually initially:

https://codepen.io/shumstra/pen/LYaWovv

Passing functions around as values has increasingly become my jam.

If our event listener made use of the event argument passed to it, you would still need to create an Event object and in that case it just might be easier and cleaner to dispatch an event manually.

(btw, thank you for all you do, Chris! 😃)

]]>