The TaskPriorityChangeEvent is the interface for the prioritychange event.
On this page
TaskPriorityChangeEvent
Constructor
-
TaskPriorityChangeEvent() -
Creates a new
TaskPriorityChangeEventobject, setting an event name and previous priority.
Instance properties
This interface also inherits the properties of its parent, Event.
TaskPriorityChangeEvent.previousPriorityRead only-
Returns the priority of the corresponding
TaskSignalbefore thisprioritychangeevent.
Instance methods
This interface has no methods of its own, but inherits the methods of its parent, Event.
Examples
An object of this type is returned in the handler for a prioritychange event. The code below shows a handler in which the newPriority and previousPriority are logged.
js
// Listen for 'prioritychange' events on the controller's signal.
controller.signal.addEventListener("prioritychange", (event) => {
const previousPriority = event.previousPriority;
const newPriority = event.target.priority;
console.log(`Priority changed from ${previousPriority} to ${newPriority}.`);
});
A more complete live example can be found in prioritychange event > Examples.
Specifications
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
TaskPriorityChangeEvent |
94 | 94 | 101 | No | 80 | No | 94 | 94 | No | 66 | No | 17.0 |
TaskPriorityChangeEvent |
94 | 94 | 101 | No | 80 | No | 94 | 94 | No | 66 | No | 17.0 |
previousPriority |
94 | 94 | 101 | No | 80 | No | 94 | 94 | No | 66 | No | 17.0 |
See also
prioritychangeevent
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TaskPriorityChangeEvent