Return the outline property values of a <div> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:outline

Description

Return the outline property values of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border:3px solid red;outline:3px dotted green">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Return outline</button>

<script>
function myFunction() {/*from   w  w w. j ava 2 s.  com*/
    console.log(document.getElementById("myDiv").style.outline);
}
</script>

</body>
</html>

Related Tutorials