JSFiddle - React, Tailwind, and code Playground
HTML
Welcome visitor !
<div id="cookieConsent"></div>
<script src="https://cdn.db-ip.com/js/dbip.js"
data-api-key="p6bcac47ae71f0285cb6343d9697e56e41a2cb92">
// Replace the demo key above with your own API key
</script>
<script>
function showCookieConsent() {
$("#cookieConsent").text("By looking at this page you are agreeing to our use of cookies.");
}
dbip.getVisitorInfo().then(info => {
if (info.isEuMember) {
// Only show useful warning to visitors from EU member countries
showCookieConsent();
}
});
</script>