setting css property to empty string from script

When you have overrided the value of an element's CSS attribute
through script, then you can reset the attribute back to the 
value governed by style declarations by assigning the empty 
string. Example (see *):

  <style type='text/css'>
    span {border: 1px solid red}
  <span id=myspan>lorem ipsum</span>

  e = document.getElementById("myspan");
  -> "1px" = 2;
  -> "2px"

* = "";
* window.getComputedStyle(e,"").borderLeftWidth
* -> "1px"

Is this behaviour specified by any standard, or is it just a
convention implemented by UAs? (I don't find it but maybe I am
not looking in the right places.)

Best regards
Mike Wilson

Received on Friday, 6 March 2009 16:51:55 UTC