Simplify selectionStart check

Simplify selectionStart check by using typeof. Check for (standards compliant) selectionStart before (non-standards) document.selection.