I\'m building a custom right-click menu for my system and I need to know how can I make a JavaScript function to copy the selected text, basically 100% like the original rig
no idea if this will work, but a google search yielded:
function getSel(){
var w=window,d=document,gS='getSelection';
return (''+(w[gS]?w[gS]():d[gS]?d[gS]):d.selection.createRange().text)).replace(/(^\s+|\s+$)/g,'');
}