@user715679 The above code is correct, however you may be noticing an issue with jQuery 1.5.1 and jsFiddle. Try loading jsFiddle in another browser or with jQuery 1.5 and you should see the correct results. For reference, there seems to be an issue with jQuery 1.5.1/jsFiddle when loaded in Chrome.
↧