Modal is not appearing on option selection
I have this modal:
- <div class="modal fade" id="details" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
- test
- </div>
That I want to show when the option "shows details is selected"
- <select id="exampleFormControlSelect1">
- <option id="showDetails">Show details</option>
- <option>Notify</option>
- </select>
So I have this jquery below, but the modal dont appears. Do you know why?
- $(function() {
- $('#showDetails').change(function(){
- $('#details').modal('show');
- })
- }
Same issue with:
- $(function() {
- $("#showDetails").on("change", function () {
- $('#details').modal('show');
- })
- }
And with:
- $(function() {
- $("#showDetails").on("change", function () {
- var showDetails = $(this).val();
- alert(showDetails);
- if(showDetails === 'showDetails'){
- $('#details').modal('show');
- }
- })
- }