---
title: 'Element: beforescriptexecute event'
slug: Web/API/Element/beforescriptexecute_event
tags:
  - DOM
  - Non-standard
  - Reference
browser-compat: api.Element.beforescriptexecute_event
---
{{APIRef}}{{Non-standard_header}}

> **Warning:** This event was a proposal in an early version of the specification. Do not rely on it.

The **`beforescriptexecute`** event is fired when a script is about to be executed. Cancelling the event prevents the script from executing.

It is a proprietary event specific to Gecko (Firefox).

<table class="properties">
  <tbody>
    <tr>
      <th scope="row">Bubbles</th>
      <td>Yes</td>
    </tr>
    <tr>
      <th scope="row">Cancelable</th>
      <td>Yes</td>
    </tr>
    <tr>
      <th scope="row">Interface</th>
      <td>{{domxref("Event")}}</td>
    </tr>
    <tr>
      <th scope="row">Event handler property</th>
      <td>None</td>
    </tr>
  </tbody>
</table>

## Specifications

Not part of any specification.

## Browser compatibility

{{Compat}}

## See also

- [`afterscriptexecute`](/en-US/docs/Web/API/Element/afterscriptexecute_event) event
