tim peterson
tim peterson

Reputation: 24315

Can you run execcommand on an element besides document?

Can you do execcommand on an element besides document?

I'm wondering if you can write code like this:

contentDiv.execCommand()

instead of:

document.execCommand()

Upvotes: 1

Views: 1045

Answers (1)

Tim Down
Tim Down

Reputation: 324627

No. execCommand() is limited to HTMLDocument nodes (see work-in-progress HTML Editing spec), except for IE, in which their proprietary TextRange and ControlRange objects also support execCommand().

Upvotes: 2

Related Questions