From a31e97b24be818a932a38ec1fb09e8d3bd89ea4c Mon Sep 17 00:00:00 2001 From: Casey Holzer Date: Fri, 21 Dec 2012 04:29:02 -0700 Subject: [PATCH] Fix selected option in optgroups --- bootstrap-select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-select.js b/bootstrap-select.js index ee3d269dc..a393f8441 100644 --- a/bootstrap-select.js +++ b/bootstrap-select.js @@ -106,7 +106,7 @@ var _liHtml = ''; var opt_index = null; var _this = this; - var _selected_index = this.$element.find('option:selected').index() ? this.$element.find('option:selected').index() : 0; + var _selected_index = this.$element[0].selectedIndex ? this.$element[0].selectedIndex : 0; this.$element.find('option').each(function(){ _li.push($(this).text());