This is piece of code from bookmarklet that I have in IE11. It supposes to pop up an alert box containing the text that you select or highlight in a page. It works as expected in desktop windows' IE11 but in WP's IE11 the alert box gives me blank message. Any idea why this happens and how I can fix it for WP's IE11?
javascript:(function(){var text="";if(document.getSelection){alert(document.getSelection().toString());}})();