<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Select this paragraph and click on the button to Check query command "SelectAll".</p>
<button onclick="myFunction()">Click Me</button>
<script>
function myFunction(){
//Try to replace "SelectAll" to "copy"
var flg = document.queryCommandEnabled("SelectAll");
if(flg)
alert("You can select all the text in the document");
else
alert("query command is disabled");
}
</script> </body>
</html>