Share this page 

Execute a javascript function by clicking on textTag(s): HTML/CSS

  function a() {
<a onClick="a();" style="cursor: pointer; cursor: hand;">*click here*</a>
Try it here : *click here*

NOTE : The style "cursor: pointer" works in Mozilla and Netscape 6+, IE6/Win, and IE5.x/Mac, but not IE5.x/Win where the "cursor: pointer" must be used. IE6/Win and IE5.x/Mac accept both the "pointer" and "hand"! That's why we are using "cursor: pointer; cursor: hand;". Do not reverse those two values! Written this way, NS6+ will see the first value and ignore the second, so you get pointer. In IE5.x/Win, it sees both and uses the second, so you get hand. If you reverse the values, then Netscape 6+ will be okay, but IE5.x/Win will see both and try to use the second. That won't get you the little hand-pointer icon in IE5.x/Win.

using SPAN

<span id="SpecialSpan"
      *click here*
Try it here : *click here*

The possible values for the cursor are

hand  (IE)
pointer (N)
auto (N6)
default (arrow)
text (I-bar)(N6)
wait (hour glass)(N6)
help (arrow with"?")