I have this code to hide selected options:
function connect()
{
$(\".selectbox option\").show();
$(\".selectbox\").each(function(i) {
var obj =
Hiding option elements is not always supported. A more idiomatic approach would be to disable it.
obj.prop("disabled", true);
Or simplify it like this.
$(".selectbox option:selected").prop("disabled", true);
Or this.
$(".selectbox").each(function() {
this.options[this.selectedIndex].disabled = true;
});