skip to Main Content

Using AlpineJS I have the following code:

<span class="value" x-text="calculate"></span>

The function calculate returns a number.

How to inside the x-text add the character "€" after the number?

2

Answers


  1. you can do the following:

    <span class="value" x-text="'€' + calculate"></span>
    
    Login or Signup to reply.
  2. This should work:

    <span class="value" x-text="calculate() + '€'"></span>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search