[webkit-help] Perform an action when user clicks on node with mouse

Emerick Rogul emerick at gmail.com
Fri May 14 14:06:26 PDT 2010


Hi everyone,

I'm trying to perform an action when a user clicks on a particular DOM
element in my document.  In my specific case, when the user clicks on
an image in my application, I need to modify its "src" attribute.  It
seems like the approach I need to take is to call addEventListener to
add a "click" event listener when adding my image element.  In the
event listener, I could then change the "src" attribute as needed.  Is
this the correct approach to take or is there a better way to
accomplish this?

I'm using the Chromium port of WebKit on Windows, but I think this is
a general (non platform-specific) question.

Thanks,

Emerick


More information about the webkit-help mailing list