A: 

CSS

<style type="text/css">
    body{
    cursor: url(mycursor.cur)
}
</style>

JavaScript

document.body.style.cursor = 'wait';
Tzury Bar Yochay
The cursor has to be "move" ONLY on when the mouse gets over the selected text. With this code the cursor is "move" on the whole document.
Licx
this was just an example. adjust it to your needs as you wish
Tzury Bar Yochay
@Licx, I will have to up-vote it .. and also depreciate the "SPOON FEEDING" work .. It is an acceptable and own post .. I don't find answers to "why not to up-vote it?"
infant programmer
A: 

As Tzury Bar Yochay indicates, you can do this via both CSS and JavaScript.

CSS - Use the cursor style property, which can be any of several standard values (which is preferred) or your own cursor file (but always include a fall-back using one of the standard values). Here's an example changing the cursor of any element with the "clickable" class to the standard cursor for something you can click:

.clickable {
  cursor: pointer;
}

(This should appear in your stylesheet file, or within a style element in the head of the document [if you can't use a separate file for some reason].) You can then apply that class to relevant elements.

JavaScript - The style property on an element exposes CSS styles, so you can do this:

var element = document.getElementById('someid');
element.style.cursor = 'pointer';

...although I generally prefer to do it by adding/removing a class name via the element's className property (which is a space-delimited list of classes for the element):

var element = document.getElementById('someid');
element.className += " clickable";
T.J. Crowder
I understand, but even in this case, the cursor will be "move" on the whole text, not only on the selected one.Is there a way to set CSS properties only on the selected text?
Licx
Yes, by wrapping the selected text in a `span` and applying the class to that span. I don't think there's a CSS pseudo-class for selected text.
T.J. Crowder
+2  A: 

Selection styles (not supported in IE) are the only thing that come to mind to achieve the desired effect:

::selection {
    color: red;
    cursor: move; 
}

::-moz-selection {
    color: red;
    cursor: move;
}

...but, although the text turns red (this is just a control), the cursor doesn't seem to change in either Safari or Firefox. If you wrap the text in an HTML element, however, and apply the styling to the element (via an ID or class), everything works fine.

You may be able to work around this problem by using JavaScript's window.getSelection() method to wrap the selected text in a DOM element and then style this DOM element. I'm not sure whether this is possible, though (and it might be a bit hacky).

Steve Harrison