jquery count selected options

JavaScript
var count = $("#mySelect :selected").length;
Source

Also in JavaScript: