In all instances of modals and mega menus it is often required to create a separate close button. By example your modal has a close button in the top corner of the screen which users often miss so we create a button inside the modal that we use to close the modal.
At the moment the only way I have managed to do this is to create a button with a custom attribute to target the modal by it is theme value -“e13-68” .
data-x-toggleable=“e13-68”
The problem with this approach is that when you add other elements to the page then the “e13-68” changes to a different value.
Is there another way to target to the modal so that we can close it with a custom button?
