当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Alternative .execCommand('insertText') for Opera

问题描述:

Seems like in Opera, can't use command InsertText

document.queryCommandEnabled('insertText'); // false

but

document.queryCommandEnabled('insertHTML'); // true

How can i get this work in Opera ?

document.execCommand('insertText', false, 'test');

网友答案:

Use window.opera for checking Opera, but which commands are supported, as well as their behavior varies across browsers. Firefox commands you can see here. For IE here.

分享给朋友:
您可能感兴趣的文章:
随机阅读: