Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1800 How do you control the mouse pointer?

You are here: irt.org | FAQ | JavaScript | Pointer | Q1800 [ previous next ]

This is a clear piece of HTML and JavaScript which teaches you how to control your mouse pointer

<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body bgcolor="#FFFFFF" text="#000000" OnMouseMove='Showit()'>
<script language="JavaScript"><!--
function setPointer(method) {
  if (document.all) {
    document.body.style.cursor = document.myForm.mySelect.options[document.myForm.mySelect.selectedIndex].text;

function customsetpointer() {
  if (document.myForm.checkbox.checked) {
    window.alert("mousepointer is being set to: " + document.myForm.textfield.value);
  if (document.all) {
    document.body.style.cursor = document.myForm.textfield.value;

This is some normal text
<a href="apage.html" id="myLink">hyper link text</a>
and some normal text.

<form NAME="myForm">
  <p> Set mousepointer to:
    <select name="mySelect" onChange="setPointer()">
  <p>Set pointer manually to:
    <input type="text" name="textfield">
    <input type="button" name="Button" value="Change Pointer" onClick="customsetpointer()">
    Echo back setting
    <input type="checkbox" name="checkbox" value="checkbox" checked>

<p>Edited by FreeLa/\/Cer (the_king17@hotmail.com) using DreamWeaver ;-)</p>

Submitted by FreeLa/\/Cer

©2018 Martin Webb