Javascript DOM CSS Style outline Property get

Introduction

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

alert(document.getElementById("myDiv").style.outline);

View 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>

<p id="demo"></p>
<script>
function myFunction() {//from w w w .jav a 2 s  .c  o m
  document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.outline;
}
</script>

</body>
</html>



PreviousNext

Related