v0.1

UX
#95 - Confeti al clic
¡Haz volar un divertido confeti al hacer clic!
Crear un botón que pueda borrar los valores de una o varias entradas.
Watch the video for step-by-step implementation instructions
<!-- 💙 MEMBERSCRIPT #78 v0.1 💙 CLEAR INPUT VALUES ONCLICK -->
<script>
document.addEventListener('DOMContentLoaded', () => {
const clearBtns = document.querySelectorAll('[ms-code-clear-value]');
clearBtns.forEach(btn => {
btn.addEventListener('click', () => {
const fieldIds = btn.getAttribute('ms-code-clear-value').split(',');
fieldIds.forEach(fieldId => {
const input = document.querySelector(`[data-ms-member="${fieldId}"]`);
if (input) {
input.value = '';
}
});
});
});
});
</script>verdaderoAdd these data attributes to your HTML elements in Webflow. For example: <div data-attribute="value">
More scripts in UX