views:

23

answers:

2

Hi all,

Is there a way to capture JavaScript events for when a contenteditable element begins and ends editing?

Cheers - Greg.

+2  A: 

I'm not sure exactly here, but aren't you after focus and blur? I'm not sure what else "begins and ends editing" could be translated to that has a different timing than those, unless you mean an event for every keystroke, etc.

Nick Craver
Great, works a treat thanks.
Greg
A: 

As Nick said, focus and blur will work, and in all major browsers. IE also has a number of related events (although none of these are implemented in other browsers as far as I know): activate, deactivate, beforeactivate, beforedeactivate and beforeeditfocus

Tim Down