I don’t know how widely known this one is, but it just caught me out so I thought I’d post it here.
In Firefox, the result is that the value of the element is set to an empty string. However, in Internet Explorer (and Opera, and possibly others that I haven’t tested) the value of the box is set to the string ‘null’. So the letters n,u,l and l appear in the text box.
Now I know that a text box has to have a string value so it can never truly be set to null. But how stupid is it to type cast null to ‘null’? You can’t assume that a string value of ‘null’ is equivalent to a null value, so surely the closest equivalent is an empty string?
Sometimes, goat farming seems like an attractive alternative career.