$(document).ready(function() { $("#menuOption1").select2({dropdownParent: "#menuOption1-container"}); $("#menuOption2").select2({dropdownParent: "#menuOption2-container"}); });