Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

alpine function

<div class="card" 
     x-data="data()" 
     @click="foo(number)" 
     x-text="number">
</div>    
<!-- ... -->
<script>
  function data(){
    return {
      number: '456',
      foo(num){
        alert(num);
      }
    }
  }
</script>
 
PREVIOUS NEXT
Tagged: #alpine #function
ADD COMMENT
Topic
Name
9+4 =