var clearSlct = "getSelection" in window ? function () { window.getSelection().removeAllRanges(); } : function () { document.selection.empty(); };