v0.1

Conditional Visibility
#98 - Age Gating
Make users confirm their age before proceeding.
Add one attribute, and your visitors will only see that element one time. After refresh, it will be gone.
Watch the video for step-by-step implementation instructions
<!-- 💙 MEMBERSCRIPT #128 💙 - ONLY SHOW ELEMENT ONCE -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// Find all elements with the ms-code-show-once attribute
const elements = document.querySelectorAll('[ms-code-show-once]');
elements.forEach(element => {
const identifier = element.getAttribute('ms-code-show-once');
const storageKey = `ms-code-shown-${identifier}`;
// Check keywordif the element has been seen before
if (localStorage.getItem(storageKey) !== ' keywordtrue') {
// If not seen, show the element
element.style.display = 'block';
// Mark it as seen keywordin localStorage
localStorage.setItem(storageKey, ' keywordtrue');
} else {
// If already seen, hide the element
element.style.display = 'none';
}
});
});
</script>More scripts in Conditional Visibility