Getting and setting values of Menu Radio elements through JS #702
-
I'm using a menu radio group for a dropdown menu as shown on the Layouts > Header documentation. However, there's no documentation for this particular element and I just can't figure out how to interact with it through JS. I want to:
If this isn't possible, my request is to add such features. If it is, then I'd like to see that somewhere in the documentation, because code that works with standard Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@poutena Have you tried adding a property via I believe it will work the same as a regular
Then you can get/set the value in your Livewire component's PHP file and can add an e.g. Great thing about this is you will not need to use any native JS - one of the great strengths of Livewire! |
Beta Was this translation helpful? Give feedback.
@poutena I see. In that case, you should be able to use Alpine's
x-model
in place ofwire:model
. See https://alpinejs.dev/directives/model and https://alpinejs.dev/magics/watch