HTML Web Worker API

A web worker is a JavaScript running in the background, without affecting the performance of the page.

When executing scripts in an HTML page, the page becomes unresponsive until the script is finished.

A web worker is a JavaScript that runs in the background, independently of other scripts, without affecting the performance of the page. You can continue to do whatever you want: clicking, selecting things, etc., while the web worker runs in the background.

Source: W3 Schools

The example below creates a simple web worker that count numbers in the background. When you open the page and click the 'start worker' button, you should see the numbers counting up, this indicates that the web worker is working.

Count numbers:

Note: Internet Explorer 9 and earlier versions do not support Web Workers.