jQuery(formElement).val(null) : inconsistent results in different browsers

Posted by Shehi on Stack Overflow See other posts from Stack Overflow or by Shehi
Published on 2011-03-12T23:50:23Z Indexed on 2011/03/13 0:10 UTC
Read the original article Hit count: 119

Code is here:

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 Chrome (and Safari of course) 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, resets the element value
  3. on Explorer, it does nothing

So, which one is expected behaviour? Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery