//replace it with your script <script> $('#mySelect2').select2({ dropdownParent: $('#myModal') }); </script>