1 2 3 4 5 6 7 8 9 10
const customCloseButton = document.querySelector( '#your-custom-button-id' ); const wrapper = document.querySelector('.mdp-snitcher#your-id'); if ( customCloseButton && wrapper ) { customCloseButton.addEventListener( 'click', () => { wrapper.click(); wrapper.style.display = 'none'; } ); }
You can clone a snippet to your computer for local editing. Learn more.