From 849d96570946f65cb5ed8ef81c54c757917cc4c5 Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Mon, 14 Jan 2013 16:35:56 +0100 Subject: [PATCH] Correctly count number of selected options ":selected" always returns at least one element, because the browser automatically selects the first element. Using "[selected]", only those elements that really have the "selected" attribute are returned. --- jquery.rating.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.rating.js b/jquery.rating.js index d039061..f9500cb 100644 --- a/jquery.rating.js +++ b/jquery.rating.js @@ -189,7 +189,7 @@ } // perserve the selected value // - if ( 0 !== $('option:selected', self).size() ) { + if ( 0 !== $('option[selected]', self).size() ) { //methods.setValue( methods.setValue( self.val(), elm, self ); } else {