Greg
Greg

Reputation: 21899

JavaScript event for contenteditable elements

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

Upvotes: 1

Views: 553

Answers (2)

Tim Down
Tim Down

Reputation: 324507

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

Upvotes: 0

Nick Craver
Nick Craver

Reputation: 630379

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.

Upvotes: 4

Related Questions