JSFiddle - React, Tailwind, and code Playground

by jahongirsobirov

HTML

<script src="https://signel.onrender.com/signel.js"></script>
<div id="app">
  <h1 $text="msg"></h1>
  <button $click="reverse">Reverse Message</button>
  <button $click="append">Append '!'</button>
</div>

JavaScript

let state = reactive({
  msg: "Hello, world!",
  reverse(){
    this.msg = this.msg.split('').reverse().join('')
  },
  append(){
    this.msg += '!'
  }
})

compile('#app', state)