> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/browser/event/custom/event.istrusted.md).

# event.isTrusted

{% tabs %}
{% tab title="💈範例" %}
{% hint style="info" %}
event.<mark style="color:purple;">**isTrusted**</mark>&#x20;

* <mark style="color:orange;">**true**</mark>: events coming from **real user actions (**<mark style="color:yellow;">**browser**</mark>**)**.
* <mark style="color:orange;">**false**</mark>: events generated by <mark style="color:yellow;">**scripts**</mark>.
  {% endhint %}

```markup
<button id="elem" onclick="alert('Click!');">Autoclick</button>

<script>
  let event = new Event("click");
  elem.dispatchEvent(event);        // ⭐️ script-generated event
</script>
```

{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}
