Results 1 to 1 of 1
Thread: getSelection() for image tags?
Jul 14, 2008, 13:10 #1
- Join Date
- Jul 2008
- 0 Post(s)
- 0 Thread(s)
getSelection() for image tags?
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.