11 Replies
likely either billAmount or numberOfPeople is
NaN
, but without the HTML to go along with this (preferably in a codepen) it's impossible to tell for sureUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
shouldn't be necessary, the event handler is a closure so it should have the outer state wrapped up inside
wait, no, you're right
nm, I was thinking of getting the elements, you're absolutely 100% correct the parsefloats need to be in the listener
also maybe its an idea to use radio buttons instead (inside a form and grouped by name). then you can use a single
change
or input
event on the form
as example https://codepen.io/MarkBoots/pen/MWBWMpV?editors=1111this works. but is there a reason why it doesn't work outside the eventlistener?
i dont quite get it. moreso because the codepen link appears broken so i dont see what you mean
cheers guys
i restored the codepen, you can check what i mean
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
thanks alot, i get it now
make sure you fork the pen for if you need it later. i might delete it again
makes sense
pen removed, backup