GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

TaskPriorityChangeEvent: TaskPriorityChangeEvent() constructor

Prioritized Task Scheduling API

Prioritized Task Scheduling API

The **`TaskPriorityChangeEvent()`** constructor creates a new TaskPriorityChangeEvent object.

This object is created with a value indicating the [previous priority](/docs/Web/API/Prioritized_Task_Scheduling_API#task_priorities) of the task: the priority before it changed and this event was fired.

## Syntax

```js-nolint
new TaskPriorityChangeEvent(type, options)
```

### Parameters

- `type`
- : A string with the case-sensitive name of the associated event.
User agents set it to `"prioritychange"`.

- `options`
- : An object that, _in addition of the properties defined in Event()_, can have the following properties:
- `previousPriority`
- : A string indicating the _previous_ [priority](/docs/Web/API/Prioritized_Task_Scheduling_API#task_priorities) of the task.
One of: [`"user-blocking"`](/docs/Web/API/Prioritized_Task_Scheduling_API#user-blocking), [`"user-visible"`](/docs/Web/API/Prioritized_Task_Scheduling_API#user-visible), [`"background"`](/docs/Web/API/Prioritized_Task_Scheduling_API#background).

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"TaskPriorityChangeEvent: TaskPriorityChangeEvent() constructor". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/TaskPriorityChangeEvent/TaskPriorityChangeEvent

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·