August 2024
Intermediate to advanced
186 pages
4h 3m
English
Before moving on, try the following things to make sure you understand how to use Alpine and _hyperscript to add interactivity.
Write an app that has an input element with its type attribute set to “range,” which displays a slider. Use this to represent a temperature in either Celsius or Fahrenheit. Set the minimum value of the input to a value below freezing and its maximum value to an uncomfortably hot value. Use Alpine to listen for change events. Display the temperature value in blue if it’s below freezing, red if it’s uncomfortably hot or higher, and green otherwise.
Write the same app again, but use _hyperscript instead of Alpine.
Read now
Unlock full access