6 examples of 'document execcommand' in JavaScript

Every line of 'document execcommand' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
55execCommand (cmd, value = null) {
56 if (value) {
57 document.execCommand(cmd, false, value);
58 } else {
59 document.execCommand(cmd, false, null);
60 }
61}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

562function execCommand(target, name) {
563 return $.data(target, "codemirror").cm.execCommand(name);
564};
205function execCommand(target, cmdName) {
206 var state = $.data(target, "ueditor");
207 return state.editor.execCommand(cmdName);
208};
182execCommand(name) { execCommand(this, name) }
77execCommand(...args) {
78 return this.editor.execCommand(...args);
79}
676function execCommand(el, execProp, execVal, bUI)
677 {
678 if(!!window.ActiveXObject || "ActiveXObject" in window)
679 {
680 var doc = el.frameWindow.document;
681 var type = doc.selection.type;
682 var oTarget = type == "None" ? doc : doc.selection.createRange();
683 var r = oTarget.execCommand(execProp, bUI, execVal);
684 if (type == "Text") oTarget.select();
685 return r;
686 }
687 else
688 {
689 var doc = document.getElementById(el.id).contentWindow.document;
690 var r = doc.execCommand(execProp, bUI, execVal);
691 return r;
692 }
693 }

Related snippets