JavaScript DHTML/Node Operation/queryCommandEnabled
"queryCommandEnabled()" Example
<source lang="html4strict">
<html> <body> <script language="JavaScript"> function function1() {
var myText = document.selection.createRange(); if (myText.queryCommandEnabled("Delete") == true) { document.execCommand("Delete"); }
} </script>
Sample text to be selected and deleted.
<input type="button" value="Delete selection" onclick="function1();"> </body> </html>
</source>