Menu
Hi All,
I have created a javascript function to get the selected content code on html page.
Basically the code will use window.getSelection(); to obtain the selection.
But the problem is, sometimes the selected area uses “ ” to create the white space and sometimes it just simply use ” “, I have found that no matter the selection is “ ” or ” “, the javascript always returns ” “.
Can anyone tell me how to have javascript return the correct selection? Like if the white space is “ ” so just return “ ”, if it is ” ” so return ” “.
Thanks a lot!
Cheers,