Javascript DOM CSS Style cursor Property get

Introduction

Return the type of cursor:

alert(document.getElementById("myP").style.cursor);

View in separate window

<!DOCTYPE html>
<html>
<body>

<p id="myP" style="cursor:wait;">This is a paragraph. Mouse over me.</p>

<button type="button" onclick="myFunction()">Return type of cursor</button>

<p id="demo"></p>
<script>
function myFunction() {/*from www  .j  av a  2s . c om*/
  document.getElementById("demo").innerHTML = document.getElementById("myP").style.cursor;
}
</script>

</body>
</html>



PreviousNext

Related