Jeff,
>> // remove selected items from the #mySelect element
>> var oRemoved = $("option:selected", oSelect).remove();
>>
>> -- or --
>>
>> var oRemoved = oSelect.find("option:selected").remove();
>>
>
>How would you identify an individual option index using this syntax?
>In other words if I want
> // remove selected items from the #mySelect element
> var oRemoved = $("option:selected", oSelect).remove();
>
> -- or --
>
> var oRemoved = oSelect.find("option:selected").remove();
>
How would you identify an individual option index using this syntax?
In other words if I wanted to check the v
> Now for Part 2 of the lesson. :)
>
> // remove selected items from the #mySelect element
> var oRemoved = $("option:selected", oSelect).remove();
>
That's the ticket! I had just finished caching the #mySelect
reference like that, and was just trying to figure out how to make
that call, but cou
Jeff,
>> First off, always try to cache jQuery objects if you're planning on
>reusing
>> them. This speed things up considerably, as jQuery doesn't have to keep
>> doing the parsing.
>
>Good point.
>
>
>> With all that said, you should be able what you're wanting in one
>command:
>>
>> var oRemov
>
> First off, always try to cache jQuery objects if you're planning on reusing
> them. This speed things up considerably, as jQuery doesn't have to keep
> doing the parsing.
>
Good point.
> With all that said, you should be able what you're wanting in one command:
>
> var oRemoved = $("#mySele
Jeff,
>for (i = $("#mySelect")[0].length - 1; i>=0; i--) {
> if ($("#mySelect option:selected")[i]) {
>$("#mySelect").removeOption(i);
> }
>}
First off, always try to cache jQuery objects if you're planning on reusing
them. This speed things up considerably, as jQuery doesn't have to keep
Hey Dan,
> Personally, I'd use $("#mySelect")[0].length, since it uses the actual DOM
> property for the element. This should be faster than parsing out
> the option tags that are selected.
>
Yep, I like that as well.
> However, the $("#mySelect option:selected") would allow you do other thing
Worked, thanks Dennis.
On May 7, 11:15 am, spinnach <[EMAIL PROTECTED]> wrote:
> try $("#mySelect")[0].length ...
>
Jeff,
>I apologize in advance if this is in the docs, but I probably won't be
>able to access the jQuery site for a while now that the ip has
>changed, due to proxy issues.
>
>I want to limit a user from entering more than a specified number of
>options, and can't find the correct syntax (or mayb
try $("#mySelect")[0].length ...
dennis.
Jeff Fleitz wrote:
I apologize in advance if this is in the docs, but I probably won't be
able to access the jQuery site for a while now that the ip has
changed, due to proxy issues.
I want to limit a user from entering more than a specified number of
10 matches
Mail list logo