_hyperscript
_hyperscript copied to clipboard
toggle not working within label
<label _="on click toggle .bg-gray-300 on me" class="p-4 border rounded cursor-pointer hover:bg-gray-200"> <input type="checkbox" name="{{ category }}" value="{{ option }}" class="hidden"> <div>{{ option }}</div> </label>
This doesn't work. If I replace the label with a div, it works as intended.
Any ideas why? :)
@pmz I just tried using a very simple setup, also using tailwindcss like you seem to be using and it works as intended:
<html>
<head>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<label _="on click toggle .bg-gray-300 on me" class="p-4 border rounded cursor-pointer hover:bg-gray-200">
My Label
</label>
</body>
</html>