Select box manipulation with jQuery - update to removeOption
The previous update to this collection of plugins introduced a cache when adding options (i.e. made it much faster if adding a lot of options). However, it was not cleared when remove options (causing possible conflicts). This is now done and an extra parameter has been added to removeOption (of boolean type), that when set to true, will only remove options if it matches any option(s) defined by the first parameter. More details and download from the Select Box Manipulation project page at the jQuery site. A demo is also available.
Comments
It's late but I really need to do some select box manipulation on mouseover events, but I just need some html AND jscode together.
I've seen your example page and it looks great and what I need but right now I can't figure out what I need for the html to trigger the events necessary to add and remove fields from the form list.
Would appreciate any hint
This adds a value to a select box when you mouse over any anchors elements in a list. Probably not exactly what you are looking for, but maybe of some help?
HTML:
<ul id="linklist">
<li><a href="http://www.jquery.com">jQuery</a></li>
<li><a href="http://www.google.com">Google</a></li>
<li><a href="http://www.yahoo.com">Yahoo</a></li>
</ul>
<select id="mylinks"></select>
JavaScript (in $(document).ready):
$mylinks = $("#mylinks");
$("#linklist a").mouseover(function() {
$mylinks.addOption($(this).text(), this.href);
});