bitty installation snippets examples documentation q&a

snippets

use an alternate listener

mouse over this text
  • bitty listens for click and form related events by default. The data-listen attribute can be used to change the event listener for an element.

html

<div data-s="snippet" data-r="snippet" data-listen="mouseover">mouse over this text</div>

javascript

export const b = {};

export function snippet(_, __, el) {
  el.innerHTML = `got mouseover at ${b.time()}`;
}