How can we get randomly selected text and image in javascripton on mouseup from page?
<p>I want to get selected text and image on a mouse event.  I've tried <code>window.getSelection()</code> but this will return only selected text not images.</p>

<p>Can someone help me understand how I can get the selected image in JavaScript?</p>
