memory.html 464 B

1234567891011121314151617
  1. <html>
  2. <script src="http://alpine-next.test/packages/alpinejs/dist/cdn.js" defer></script>
  3. <div x-data="{ items: [] }">
  4. <template x-for="item in items">
  5. <h1>hi</h1>
  6. </template>
  7. <button @click="items.length === 0 ? items.push('ggoo') : items = []" x-text="'ghjghj'">delete</button>
  8. </div>
  9. <script>
  10. function remove() {
  11. document.querySelector('span').remove()
  12. }
  13. </script>
  14. </html>