📑
カスタムイベント自作
const event = new CustomEvent('foo', {
detail: {foobar: 'barfoo'}
})
const el = document.querySelector('.bar')
el.dispatchEvent(event)
const event = new CustomEvent('foo', {
detail: {foobar: 'barfoo'}
})
const el = document.querySelector('.bar')
el.dispatchEvent(event)
Discussion