You can pass plugin options as data attributes for adding in directly js selector. Please check plugin docs for more information.
Plugin Docs<select class="select2" name="states[]" multiple="multiple"> <option value="AL">Alabama</option> <option value="WY">Wyoming</option> <option value="LH">Lahore</option> <option value="KA">Karachi</option></select>