I have a web page with a <select>
menu and want to add an onchange
handler written in Reason (this is plain JS, not React). I tried writing a function like this:
let handleChange = (_evt) => { ... }
and in the HTML, used <select onchange="handleChange">
, but this gives me a ReferenceError
. Trying to set the attribute from Reason using Element.setAttribute
gives the same result.
I am overlooking something obvious; what is it? [Edit: I am using parcel
as a bundler.]