x-model ======= `x-model` allows you to bind the value of an input element to Alpine data. Here's a simple example of using `x-model` to bind the value of a text field to a piece of data in Alpine.
 
Now as the user types into the text field, the `message` will be reflected in the `` tag. `x-model` is two-way bound, meaning it both "sets" and "gets". In addition to changing data, if the data itself changes, the element will reflect the change. We can use the same example as above but this time, we'll add a button to change the value of the `message` property.
 
Change Message Now when the ` 
Change username to: 'phantomatrix' calebporzio [← x-html](/directives/html) [x-modelable →](/directives/modelable) Code highlighting provided by [Torchlight](https://torchlight.dev)