Javascript DOM CSS Style cursor Property for all available cursors

Introduction

Show all available cursors:

View in separate window

<!DOCTYPE html>
<html>
<body>

<p>Select a cursor in the list below and move the cursor over the body.</p>

<select onchange="myFunction(this);" size="32">
  <option>alias
  <option>all-scroll
  <option>auto
  <option>cell
  <option>context-menu
  <option>col-resize
  <option>copy
  <option>crosshair
  <option>default
  <option>e-resize
  <option>ew-resize
  <option>help
  <option>move
  <option>n-resize
  <option>ne-resize
  <option>nw-resize
  <option>ns-resize
  <option>no-drop
  <option>none
  <option>not-allowed
  <option>pointer
  <option>progress
  <option>row-resize
  <option>s-resize
  <option>se-resize
  <option>sw-resize
  <option>text
  <option>vertical-text
  <option>w-resize
  <option>wait
  <option>zoom-in
  <option>zoom-out
</select>/* www . j ava2  s  . c  o m*/

<script>
function myFunction(x) {
  var whichSelected = x.selectedIndex;
  document.body.style.cursor = x.options[whichSelected].text;
}
</script>

</body>
</html>



PreviousNext

Related