jQuery(formElement).val(null) : inconsistent results in different browsers
http://jsfiddle.net/jf7t2/1/
Please run it on the latest versions of all browsers, and see for yourself. When the button is clicked, on:
1. on WebKit browsers (Chrome, Safari) it just doesn't select anything, instead creates some ghostly empty option
2. on Firefox and Opera, it works the way I expect and want it to work, de-selects all options of the element
3. on Explorer, it does nothing
jQuery 1.5.1 source code also tells us that, in this case jQuery sets selectedIndex = -1.
http://stackoverflow.com/questions/5286424/jqueryformelement-valnull-inconsistent-results-in-different-browsers/5286643#5286643
But since browsers mess it up in this case, shouldn't jQuery force it to behave the way Firefox and Opera does, de-select all child options?
Thanks.