Get the outline style of a <div> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:outlineStyle

Description

Get the outline style of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {/*from  www  .ja v  a  2s.com*/
    border: 1px solid red;
}
</style>
</head>
<body>

<div id="myDiv" style="outline-style:dotted;">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Return outline style</button>

<script>
function myFunction() {
    console.log(document.getElementById("myDiv").style.outlineStyle);
}
</script>

</body>
</html>

Related Tutorials