Skip to content

Instantly share code, notes, and snippets.

@usmonster
Last active December 25, 2015 16:49
Show Gist options
  • Save usmonster/7009049 to your computer and use it in GitHub Desktop.
Save usmonster/7009049 to your computer and use it in GitHub Desktop.
The CSS rule `outline:none;` causes IE8 to barf when accessing a target element's `.currentStyle["outline"]` (or `.currentStyle["outlineWidth"]`). Fun! If you must, use instead `outline:0;` or `outline:none 0;`. (But really, [just avoid it](http://www.outlinenone.com), okay?) (Note: this is fine when in a newer IE version but in "IE8 Standards m…
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<title>title</title>
</head>
<body>
<div id="foo" style="outline:none;">Test</div>
<script language="javascript" type="text/javascript">
var div = document.getElementById('foo');
var cs = div.currentStyle;
//debugger;
var asplode = cs["outline"];
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment