You are here: irt.org | FAQ | JavaScript | Pointer | Q275 [ previous next ]
Only in Internet Explorer 4:
This is some normal text <a href="apage.html" style="cursor:text;">hyper link text</a> and some normal text.
You could use the following to test the different type of mouse pointers:
<script language="JavaScript"><!-- function setPointer() { if (document.all) document.all("myLink").style.cursor = document.myForm.mySelect.options[document.myForm.mySelect.selectedIndex].text; } //--></script> This is some normal text <a href="apage.html" id="myLink">hyper link text</a> and some normal text. <form NAME="myForm"> <select name="mySelect" onChange="setPointer()"> <option>auto <option>crosshair <option>default <option>hand <option>move <option>e-resize <option>ne-resize <option>nw-resize <option>n-resize <option>se-resize <option>sw-resize <option>s-resize <option>w-resize <option>text <option>wait <option>help </select> </form>
The following was submitted by Tom
Define a function that reacts to an onclick event. The function will be called without the pointer changing. In the function, define a new location.
<script language="Javascript"><!-- function NewPage() { window.location = "http://www.yahoo.com"; } //--></script> <img src=myImage.gif" width="192" height="124" alt="" border="0" onclick="NewPage()"> <p onclick="NewPage()">Click me to go to Yahoo...</p>