Which x-on directive to use inside <option> tag? @click does not seem to work on <option> tag #2292
Answered
by
SimoTod
feelosophy13
asked this question in
1. Help
-
I'd like to trigger an action when a specific
|
Beta Was this translation helpful? Give feedback.
Answered by
SimoTod
Nov 1, 2021
Replies: 1 comment
-
Click events don't generally work for option tags: https://stackoverflow.com/questions/29056379/onclick-event-doesnt-work-in-chrome <div x-data>
<select @change="alert($el.value)">
<option selected disabled></option>
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</select>
</div> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
feelosophy13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Click events don't generally work for option tags: https://stackoverflow.com/questions/29056379/onclick-event-doesnt-work-in-chrome
You can use
@change
on the select tag