Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lindesvard/15eb25f39925b4d6e643be799507835a to your computer and use it in GitHub Desktop.
Save lindesvard/15eb25f39925b4d6e643be799507835a to your computer and use it in GitHub Desktop.
// Pure JS
const input = document.querySelector('input')
if(input) {
input.addEventListener('blur', (event) => {
window.op('event', 'search', {
query: event.target.value
})
})
}
// React
import { Openpanel } from '@openpanel/web';
const op = new Openpanel({
clientId: '{YOUR_CLIENT_ID}',
});
<input onBlur={(event) => op.event('search', { query: event.target.query }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment