Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section 4.4.2 -> Function on-change #159

Open
pwhittin opened this issue Oct 15, 2020 · 0 comments
Open

Section 4.4.2 -> Function on-change #159

pwhittin opened this issue Oct 15, 2020 · 0 comments

Comments

@pwhittin
Copy link

In order to create what I believe to be the intended behavior I needed to make the definition of the "on-change" function the following:

(defn on-change
  [event]
  (let [target (.-target event)
        value-string (.-value target)]
    (if (str/blank? value-string)
      (set! (.-innerHTML result) "----")
      (let [value (read-string value-string)]
        (if (leap? value)
          (set! (.-innerHTML result) "YES")
          (set! (.-innerHTML result) "NO"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant