0 minutes, 24 seconds

Alpine Test XBIND

x-bind allows you to set HTML attributes on elements based on the result of JavaScript expressions.

Alpine supports attributes binding using the x-bind directive.

The x-bind directive enables you to bind an HTML attribute to a JavaScript expression. The directive works the same way as v-bind in vue.js.

As with events handling, you can also use the shorthand form (:).

<div
    x-data="{
    caption: 'Random image from picsum.photos',
    src: 'https://picsum.photos/250/250',
    width: '250'
  }"
>

()

Previous Next