Javascript DOM CSS Style overflow Property get

Introduction

Return the overflow property:

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

View in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border:1px solid red;width:100px;height:100px;overflow:scroll;">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</div>/*  w w w  .  j ava  2s.  co  m*/
<br>
<button type="button" onclick="myFunction()">Return overflow</button>

<p id="demo"></p>

<script>
function myFunction() {
  document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.overflow;
}
</script>

</body>
</html>



PreviousNext

Related