I have some jQuery code that copies the selected values from one listbox to another:
$(adPerson + " option:selected").each(function(){
$(toNames).append($(this).clone());
});
I'm trying to make sure no blank lines are added to the destination listbox, so I tried this:
$(adPerson + " option:selected").each(function(){
if($(this).text != "")
{
$(toNames).append($(this).clone());
}
});
The above code does not work - I think is is because of the way .each is used.
Any ideas?
Derek