@teedmaker/outside-click
v2.0.0
Published
A simple project to help you to use outside-click in your javascript project
Downloads
10
Readme
Outside cick

A simple package to help identifying a outside click of an element
Examples
Dispatch an alert when user clicks outside of an element with the id click-me:
<!DOCTYPE html>
<html lang="en">
<body>
<main role="main">
<textarea
name="example"
id="example"
placeholder="Click on another element on the page"
></textarea>
</main>
<script defer>
OutsideClick.create('#example').trigger(() => {
document.querySelector('#example').style.background = 'red';
});
</script>
</body>
</html>