# HTML DOM onseeking Event
The `onseeking` event occurs when the user starts moving or skipping to a new position in an audio or video file.
This event is triggered as soon as the seeking process begins (e.g., when a user drags the playhead to a new time on the progress bar).
---
## Definition and Usage
The `onseeking` event is fired when a seek operation starts on a media element (`
` or ``).
* **Related Event:** The opposite of the `onseeking` event is the (event-onseeked.asp) event, which fires when the user has finished moving to the new position in the audio/video.
* **Useful Property:** You can use the `currentTime` property of the media element to set or return the current playback position (in seconds).
---
## Browser Support
The numbers in the table specify the first browser version that fully supports this event.
| Event | Chrome | Internet Explorer / Edge | Firefox | Safari | Opera |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **onseeking** | Yes | 9.0 | Yes | Yes | Yes |
---
## Syntax
### In HTML
```html
```
### In JavaScript
```javascript
object.onseeking = function() {
myScript;
};
```
### In JavaScript using `addEventListener()`
```javascript
object.addEventListener("seeking", myScript);
```
> **Note:** The `addEventListener()` method is not supported in Internet Explorer 8 and earlier versions.
---
## Technical Details
| Property | Value |
| :--- | :--- |
| **Bubbles** | No |
| **Cancelable** | No |
| **Event Type** | Event |
| **Supported HTML Tags** | ``, `` |
---
## Code Examples
### Example 1: Basic Usage with HTML Attribute
Execute a JavaScript function when the user starts moving to a new playback position in a video:
```html
Your browser does not support the video tag.
```
---
### Example 2: Difference Between `onseeking` and `onseeked`
This example demonstrates the sequence of the `onseeking` and `onseeked` events. The `seeking` event fires when the user starts dragging the playhead, while the `seeked` event fires when the user releases the playhead and the media jumps to the new position.
```html
```
---
### Example 3: Displaying the Current Time During Seek
Use the `currentTime` property of the Video object to display the current playback position as soon as the user starts seeking:
```html
Seek position: 0 seconds
```
---
### Example 4: Audio Element Example
Execute a JavaScript function when the user starts seeking in an audio file:
```html
Your browser does not support the audio element.
```