Sure. Here's an example. I haven't used jQuery, so here it is in plain
JavaScript:
var texts = document.getElementsByTagName('textarea');
for (var i=0; i<texts.length; i++) {
var text = texts[i];
var image = document.createElement('img');
image.src = chrome.extension.getURL('icon.png');
text.parentNode.insertBefore(image, text.nextSibling);
image.addEventListener('click', function(e) {
text.value = text.value + 'hello!';
}, false);
}
Regards,
Max
On Dec 14, 7:21 pm, Alex <[email protected]> wrote:
> On 14 Dec, 17:06, Max <[email protected]> wrote:
>
> > I've run into this problem as well. The solution I ended up using was
> > pretty simple. Instead of inserting HTML, create the element through
> > the DOM and set its handler attributes. That way you can call back
> > into your own content script without a problem.
>
> Any chance of pointing to an example of how you did that?
> Can I set handlers for each textarea that way?
>
> --
> Alex
--
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en.