-
How do I handle Drawer state using JavaScript ? |
Beta Was this translation helpful? Give feedback.
Answered by
saadeghi
Mar 2, 2023
Replies: 1 comment 1 reply
-
It has a hidden checkbox. You can check/uncheck the checkbox using JS <div class="drawer">
<input id="my-drawer" type="checkbox" class="drawer-toggle" /> <!-- 👈👈👈👈 HERE -->
<div class="drawer-content">
<!-- Page content here -->
<label for="my-drawer" class="btn btn-primary drawer-button">Open drawer</label>
</div>
<div class="drawer-side">
<label for="my-drawer" class="drawer-overlay"></label>
<ul class="menu p-4 w-80 bg-base-100 text-base-content">
<!-- Sidebar content here -->
<li><a>Sidebar Item 1</a></li>
<li><a>Sidebar Item 2</a></li>
</ul>
</div>
</div> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
saadeghi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It has a hidden checkbox. You can check/uncheck the checkbox using JS