Hi, I'm tweaking a wysiwyg and have run into a problem.

I've been using getSelection() or document.selection.createRange() to grab the selected text and manipulate it. It has taken an amateur like me very far.

However, now i need grab the selected image element for manipulation, but the aforementioned functions only return the "alt" text and not the element itself.

i was using getSelection.focusNode.firstChild to select something like this:
<p><img src="some_guy" /></p>, but that only works if the image is wrapped in another element.

Any suggestions?