Created
April 8, 2024 20:11
-
-
Save lindesvard/15eb25f39925b4d6e643be799507835a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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