*sorry my bad english
I think understand it.
1. Those 3 elements was are loaded.
2. sidr replicate those 3 elements content.
Result: twice elements
I was be trying catch an checkbox form in mobile menu by element id, and always all unchecked.
what was happening is that I was fill out the form in sidr (2) but reading the (1)
SOLUTION (for lack of something better)
* it is necessary to place the code somewhere in the mobile menu.
It will not serve place it in additional JS.
I pasted it in a mobile menu link, just after the visible name: Link_Text <script> … </script>
* It will be executed twice, when loading nav-menu and when creating the sidr.
Therefore, it must be prevented from running the first time, so that sidr can correctly replicate the 3 elements before deleting them (if)
<script>
if ( document.getElementById('sidr') ) {
document.getElementById('sidr-close').remove();
document.getElementById('mobile-nav').remove();
/* Only if search menu is active */
document.getElementById('mobile-menu-search').remove();
}
</script>