Set the Content of Elements: x-text and x-html
Learn to manipulate the text content of HTML elements with x-text and to append HTML content to an element with x-html.
We'll cover the following
The x-text
directive
There are times we may want to set the text content of an HTML element. AlpineJS allows us to do this using the x-text
directive.
Consider the example below from the “Hello Alpine” program:
Get hands-on with 1200+ tech skills courses.