Reputation: 24315
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
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