1
  <html><body><div class="modal fade" id="myModal">
  <div class="modal-dialog modal-xl" role="document">
  <div class="modal-content">Hello Modal</div></div></div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>

  <script> function showModal { $('#myModal').modal('show') }</script>
  </body></html>

When calling showModal:

Uncaught TypeError: $(...).modal is not a function

What am I doing wrong?

Cœur
  • 37,241
  • 25
  • 195
  • 267
needitohelp
  • 103
  • 2
  • 7

1 Answers1

1

your code should look like this

 <script> function showModal() { $('#myModal').modal('show'); };</script>

this should be ok

LordK
  • 151
  • 1
  • 4