property selectionStart

(r/o) int32 selectionStart;

Typ

Zugriff

This property returns the index of the character in the edit field of where the currently selected text starts. If there is no selection, then the property returns 0.
function DoesEditHaveSelection(editBx)
{
    var hasSel = false;
    if (editBx)
    {
        var startPos = editBx.selectionStart;
        var endPos   = editBx.selectionEnd;

        hasSel = (startPos == 0) && (endPos == 0);
    }

    return hasSel;
}