# Close app on FlexPendant with JavaScript

**URL:** <https://tech-community.robotics.abb.com/t/close-app-on-flexpendant-with-javascript/15155>\
**Category:** AppStudio\
**Created:** [September 22, 2026, 6:17am UTC](https://tech-community.robotics.abb.com/t/close-app-on-flexpendant-with-javascript/15155 "2026-09-22T06:17:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anders\_Lindh\_Ewing](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@Anders\_Lindh\_Ewing](https://tech-community.robotics.abb.com/u/Anders_Lindh_Ewing)\
**Post date:** [September 22, 2026, 6:18am UTC](https://tech-community.robotics.abb.com/t/close-app-on-flexpendant-with-javascript/15155/1 "2026-09-22T06:18:00Z")

</div>

How to write a JavaScript to close my App?

---

<div class="post-metadata">

**Author:** ![yitong](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yitong](https://tech-community.robotics.abb.com/u/yitong)\
**Post date:** [September 22, 2026, 7:18am UTC](https://tech-community.robotics.abb.com/t/close-app-on-flexpendant-with-javascript/15155/2 "2026-09-22T07:18:41Z")

</div>

```js
await App.Interaction.closeApp()

```

* * *

You can operate like this by referring to this completed code.

1. Drag a btton into workspace, and then set its functionality be `close current app`

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/3/3ff7e6fd6a3d67d80311e2f4aa8de2f46652c2c0.png)

1. This code will be automatically appended to the onclick event of the button component; check it in the behavior interface.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/d/d2a4cfcfd761345c3e641be4904100f82380b6b1.png)

So, other similar features can also be viewed in this way.
