Example 1 — Check SelectAll Support
MDN pattern: only continue when the command is supported.
const flg = document.queryCommandSupported("SelectAll");
console.log("SelectAll supported:", flg);
if (flg) {
console.log("Safe to consider SelectAll in this browser");
} How It Works
- Ask about support.
queryCommandSupported("SelectAll")returns a boolean. - Log the result. Useful when comparing browsers or debugging a toolbar.
- Gate the feature. Only treat SelectAll as available when
flgistrue. - Remember status. This is legacy — prefer modern APIs for new products.

