Skip to content

Section 4.4.2 -> Function on-change #159

Open
@pwhittin

Description

@pwhittin

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"))))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions