<html>
<head>
<style type="text/css">
#ex1
{
border:1px solid red;
outline:green dotted thick;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.outlineColor="#0000FF";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change outline color</button>
<p><b>Note:</b> IE8 supports the outline properties only if a !DOCTYPE is specified.</p>
</body>
</html>