From 818eadabae562713adf24153206275ab810061d6 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Mon, 16 Sep 2024 18:50:13 +0100 Subject: [PATCH] prettier --- .../api/htmlbuttonelement/command/index.md | 24 ++++++++----------- .../web/api/invoker_commands_api/index.md | 1 + 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/files/en-us/web/api/htmlbuttonelement/command/index.md b/files/en-us/web/api/htmlbuttonelement/command/index.md index c96c7ccddac959a..3104d973dffd0f5 100644 --- a/files/en-us/web/api/htmlbuttonelement/command/index.md +++ b/files/en-us/web/api/htmlbuttonelement/command/index.md @@ -23,7 +23,9 @@ A string. ### Basic example ```html - +
@@ -40,28 +42,22 @@ toggleBtn.command = "show-popover"; ### Custom example, using events ```html - + - + - + ``` ```js const image = document.getElementById("the-image"); image.addEventListener("command", (event) => { - - if ( event.command == "--rotate-left" ) { - event.target.style.rotate = "-90deg" - } else if ( event.command == "--rotate-right" ) { - event.target.style.rotate = "90deg" + if (event.command == "--rotate-left") { + event.target.style.rotate = "-90deg"; + } else if (event.command == "--rotate-right") { + event.target.style.rotate = "90deg"; } - }); ``` diff --git a/files/en-us/web/api/invoker_commands_api/index.md b/files/en-us/web/api/invoker_commands_api/index.md index 9acb5a84b0f36d4..077a87e0d9f9c1b 100644 --- a/files/en-us/web/api/invoker_commands_api/index.md +++ b/files/en-us/web/api/invoker_commands_api/index.md @@ -25,6 +25,7 @@ Historically creating these kinds of controls has required JavaScript event list - [`commandfor`](/en-US/docs/Web/HTML/Element/button#commandfor): - : Turns a {{htmlelement("button")}} element into a control button, controlling the given interactive element; takes the ID of the element to control as its value. - [`command`](/en-US/docs/Web/HTML/Element/button#command): + - : Specifies the action to be performed on an element being controlled by a control `