diff --git a/files/en-us/web/api/abstractworker/index.html b/files/en-us/web/api/abstractworker/index.html index 3ff7a7a67673806..c1c65d7d95ce77b 100644 --- a/files/en-us/web/api/abstractworker/index.html +++ b/files/en-us/web/api/abstractworker/index.html @@ -37,7 +37,7 @@

Example

This code snippet demonstrates the creation of a new Worker using the {{domxref("Worker.Worker", "Worker()")}} constructor; it also shows how to then send a message to the worker.

-
var myWorker = new Worker('worker.js');
+
var myWorker = new Worker('worker.js');
 
 first.onchange = function() {
   myWorker.postMessage([first.value, second.value]);
diff --git a/files/en-us/web/api/abstractworker/onerror/index.html b/files/en-us/web/api/abstractworker/onerror/index.html
index 9b843e6509c9d28..0f0654964a9e205 100644
--- a/files/en-us/web/api/abstractworker/onerror/index.html
+++ b/files/en-us/web/api/abstractworker/onerror/index.html
@@ -17,7 +17,7 @@
 
 

Syntax

-
myWorker.onerror = function() { ... };
+
myWorker.onerror = function() { ... };

Example

diff --git a/files/en-us/web/api/addresserrors/addressline/index.html b/files/en-us/web/api/addresserrors/addressline/index.html index 5ee0c6ddc12ea8d..2c4838cb97f1c7e 100644 --- a/files/en-us/web/api/addresserrors/addressline/index.html +++ b/files/en-us/web/api/addresserrors/addressline/index.html @@ -19,7 +19,7 @@

Syntax

-
var addressLineError = AddressErrors.addressLine;
+
var addressLineError = AddressErrors.addressLine;

Value

diff --git a/files/en-us/web/api/addresserrors/city/index.html b/files/en-us/web/api/addresserrors/city/index.html index e18c6806b30b3c8..9e29f0d0bf15dff 100644 --- a/files/en-us/web/api/addresserrors/city/index.html +++ b/files/en-us/web/api/addresserrors/city/index.html @@ -20,7 +20,7 @@

Syntax

-
var cityError = AddressErrors.city;
+
var cityError = AddressErrors.city;

Value

diff --git a/files/en-us/web/api/addresserrors/country/index.html b/files/en-us/web/api/addresserrors/country/index.html index 3195b5ce2eb4461..064e8c10ff62009 100644 --- a/files/en-us/web/api/addresserrors/country/index.html +++ b/files/en-us/web/api/addresserrors/country/index.html @@ -19,7 +19,7 @@

Syntax

-
var countryError = AddressErrors.country;
+
var countryError = AddressErrors.country;

Value

diff --git a/files/en-us/web/api/addresserrors/dependentlocality/index.html b/files/en-us/web/api/addresserrors/dependentlocality/index.html index 43658593acd6d34..5f1782153c79178 100644 --- a/files/en-us/web/api/addresserrors/dependentlocality/index.html +++ b/files/en-us/web/api/addresserrors/dependentlocality/index.html @@ -20,7 +20,7 @@

Syntax

-
var localityError = AddressErrors.dependentLocality;
+
var localityError = AddressErrors.dependentLocality;

Value

diff --git a/files/en-us/web/api/addresserrors/languagecode/index.html b/files/en-us/web/api/addresserrors/languagecode/index.html index 59fbe256de41d39..bc02a8d25424f8d 100644 --- a/files/en-us/web/api/addresserrors/languagecode/index.html +++ b/files/en-us/web/api/addresserrors/languagecode/index.html @@ -21,7 +21,7 @@

Syntax

-
var languageError = AddressErrors.languageCode;
+
var languageError = AddressErrors.languageCode;

Value

diff --git a/files/en-us/web/api/addresserrors/organization/index.html b/files/en-us/web/api/addresserrors/organization/index.html index 1479eb9d5d3d16d..edf0cf21b89642c 100644 --- a/files/en-us/web/api/addresserrors/organization/index.html +++ b/files/en-us/web/api/addresserrors/organization/index.html @@ -20,7 +20,7 @@

Syntax

-
var organizationError = AddressErrors.organization;
+
var organizationError = AddressErrors.organization;

Value

diff --git a/files/en-us/web/api/addresserrors/phone/index.html b/files/en-us/web/api/addresserrors/phone/index.html index 783bc4c680f0a17..efb50525a1a0a11 100644 --- a/files/en-us/web/api/addresserrors/phone/index.html +++ b/files/en-us/web/api/addresserrors/phone/index.html @@ -23,7 +23,7 @@

Syntax

-
var phoneError = AddressErrors.phone;
+
var phoneError = AddressErrors.phone;

Value

diff --git a/files/en-us/web/api/addresserrors/postalcode/index.html b/files/en-us/web/api/addresserrors/postalcode/index.html index a05bfa8fe123fd9..ceb80a86869b888 100644 --- a/files/en-us/web/api/addresserrors/postalcode/index.html +++ b/files/en-us/web/api/addresserrors/postalcode/index.html @@ -24,7 +24,7 @@

Syntax

-
var postcodeError = AddressErrors.postCode;
+
var postcodeError = AddressErrors.postCode;

Value

diff --git a/files/en-us/web/api/addresserrors/recipient/index.html b/files/en-us/web/api/addresserrors/recipient/index.html index 3928e0faf76f229..2ac517a03b5a591 100644 --- a/files/en-us/web/api/addresserrors/recipient/index.html +++ b/files/en-us/web/api/addresserrors/recipient/index.html @@ -20,7 +20,7 @@

Syntax

-
var recipientError = AddressErrors.recipient;
+
var recipientError = AddressErrors.recipient;

Value

diff --git a/files/en-us/web/api/addresserrors/region/index.html b/files/en-us/web/api/addresserrors/region/index.html index 108cac74007ecf4..795f04ce4e8a795 100644 --- a/files/en-us/web/api/addresserrors/region/index.html +++ b/files/en-us/web/api/addresserrors/region/index.html @@ -21,7 +21,7 @@

Syntax

-
var regionError = AddressErrors.region;
+
var regionError = AddressErrors.region;

Value

diff --git a/files/en-us/web/api/addresserrors/regioncode/index.html b/files/en-us/web/api/addresserrors/regioncode/index.html index 1c5cbb2b3e8e7c5..282efb6e63a1c10 100644 --- a/files/en-us/web/api/addresserrors/regioncode/index.html +++ b/files/en-us/web/api/addresserrors/regioncode/index.html @@ -21,7 +21,7 @@

Syntax

-
var regionCodeError = AddressErrors.regionCode;
+
var regionCodeError = AddressErrors.regionCode;

Value

diff --git a/files/en-us/web/api/addresserrors/sortingcode/index.html b/files/en-us/web/api/addresserrors/sortingcode/index.html index 5075d40d3f123c8..a51033fe22bcb1e 100644 --- a/files/en-us/web/api/addresserrors/sortingcode/index.html +++ b/files/en-us/web/api/addresserrors/sortingcode/index.html @@ -21,7 +21,7 @@

Syntax

-
var sortingCodeError = AddressErrors.sortingCode;
+
var sortingCodeError = AddressErrors.sortingCode;

Value

diff --git a/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html b/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html index 26a7a40053a189a..a3658271683618e 100644 --- a/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html +++ b/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html @@ -19,7 +19,7 @@

Syntax

-
void ext.drawArraysInstancedANGLE(mode, first, count, primcount);
+
void ext.drawArraysInstancedANGLE(mode, first, count, primcount);
 

Parameters

diff --git a/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html b/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html index d0ea1dc2fc85478..d37a42e78e60d2a 100644 --- a/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html +++ b/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html @@ -19,7 +19,7 @@

Syntax

-
void ext.drawElementsInstancedANGLE(mode, count, type, offset, primcount);
+
void ext.drawElementsInstancedANGLE(mode, count, type, offset, primcount);
 

Parameters

diff --git a/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html b/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html index ccec0b321a8663f..dba1164138e3e0e 100644 --- a/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html +++ b/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html @@ -19,7 +19,7 @@

Syntax

-
void ext.vertexAttribDivisorANGLE(index, divisor);
+
void ext.vertexAttribDivisorANGLE(index, divisor);
 

Parameters

diff --git a/files/en-us/web/api/attr/localname/index.html b/files/en-us/web/api/attr/localname/index.html index 1b74fe9c57834fb..54847cafdcc1c09 100644 --- a/files/en-us/web/api/attr/localname/index.html +++ b/files/en-us/web/api/attr/localname/index.html @@ -19,7 +19,7 @@

Syntax

-
name = attribute.localName
+
name = attribute.localName
 

Return value

diff --git a/files/en-us/web/api/attr/namespaceuri/index.html b/files/en-us/web/api/attr/namespaceuri/index.html index 7099fa622c2cd4f..56157e3cc52e774 100644 --- a/files/en-us/web/api/attr/namespaceuri/index.html +++ b/files/en-us/web/api/attr/namespaceuri/index.html @@ -20,7 +20,7 @@

Syntax

namespace = attribute.namespaceURI
+ class="brush: js">namespace = attribute.namespaceURI

Example

diff --git a/files/en-us/web/api/attr/prefix/index.html b/files/en-us/web/api/attr/prefix/index.html index 94c30280f981c32..058febc5c8afd72 100644 --- a/files/en-us/web/api/attr/prefix/index.html +++ b/files/en-us/web/api/attr/prefix/index.html @@ -18,7 +18,7 @@

Syntax

-
string = attribute.prefix
+
string = attribute.prefix
 

Examples

diff --git a/files/en-us/web/api/audiocontext/audiocontext/index.html b/files/en-us/web/api/audiocontext/audiocontext/index.html index 0d5faec3a0987ba..89f351603915135 100644 --- a/files/en-us/web/api/audiocontext/audiocontext/index.html +++ b/files/en-us/web/api/audiocontext/audiocontext/index.html @@ -23,7 +23,7 @@

Syntax

-
var audioCtx = new AudioContext();
+
var audioCtx = new AudioContext();
 var audioCtx = new AudioContext(options);
 
diff --git a/files/en-us/web/api/audiocontext/baselatency/index.html b/files/en-us/web/api/audiocontext/baselatency/index.html index ef1aebe30c690cb..f1e3901f7416e2d 100644 --- a/files/en-us/web/api/audiocontext/baselatency/index.html +++ b/files/en-us/web/api/audiocontext/baselatency/index.html @@ -27,7 +27,7 @@

Syntax

var baseLatency = audioCtx.baseLatency;
+ class="brush: js">var baseLatency = audioCtx.baseLatency;

Value

@@ -35,7 +35,7 @@

Value

Example

-
// default latency ("interactive")
+
// default latency ("interactive")
 const audioCtx1 = new AudioContext();
 console.log(audioCtx1.baseLatency); // 0.00
 
diff --git a/files/en-us/web/api/audiocontext/createjavascriptnode/index.html b/files/en-us/web/api/audiocontext/createjavascriptnode/index.html
index e3cada8f7aea30b..e69eb74f597933a 100644
--- a/files/en-us/web/api/audiocontext/createjavascriptnode/index.html
+++ b/files/en-us/web/api/audiocontext/createjavascriptnode/index.html
@@ -26,7 +26,7 @@
 
 

Syntax

-
var jsNode = audioCtx.createJavaScriptNode(bufferSize, numInputChannels, numOutputChannels);
+
var jsNode = audioCtx.createJavaScriptNode(bufferSize, numInputChannels, numOutputChannels);
 

Parameters

diff --git a/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html b/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html index 842b874c806fb5b..08c2404facedd25 100644 --- a/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html +++ b/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html @@ -22,7 +22,7 @@

Syntax

-
var audioCtx = new AudioContext();
+
var audioCtx = new AudioContext();
 var destination = audioCtx.createMediaStreamDestination();

Returns

@@ -37,7 +37,7 @@

Examples

From here, you can play and save the opus file.

-
<!DOCTYPE html>
+
<!DOCTYPE html>
 <html>
   <head>
     <title>createMediaStreamDestination() demo</title>
diff --git a/files/en-us/web/api/audiocontext/createmediastreamsource/index.html b/files/en-us/web/api/audiocontext/createmediastreamsource/index.html
index 3fcc1dca56a958c..f14b342cab93263 100644
--- a/files/en-us/web/api/audiocontext/createmediastreamsource/index.html
+++ b/files/en-us/web/api/audiocontext/createmediastreamsource/index.html
@@ -29,7 +29,7 @@
 

Syntax

audioSourceNode = audioContext.createMediaStreamSource(stream);
+ class="brush: js">audioSourceNode = audioContext.createMediaStreamSource(stream);

Parameters

diff --git a/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html b/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html index f80031a724e2e02..fa21a037591a1cb 100644 --- a/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html +++ b/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html @@ -32,7 +32,7 @@

Syntax

var audioCtx = new AudioContext();
+  class="brush: js">var audioCtx = new AudioContext();
 var track = audioCtx.createMediaStreamTrackSource(track);

Parameters

diff --git a/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html b/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html index 7692e50514b9cf6..b1a1df9302f6f53 100644 --- a/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html +++ b/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html @@ -36,7 +36,7 @@

Syntax

var timestamp = AudioContext.getOutputTimestamp()
+ class="brush: js">var timestamp = AudioContext.getOutputTimestamp()

Parameters

diff --git a/files/en-us/web/api/audiocontext/index.html b/files/en-us/web/api/audiocontext/index.html index 8e5611e4075c44c..ddfcd2a5cfebd34 100644 --- a/files/en-us/web/api/audiocontext/index.html +++ b/files/en-us/web/api/audiocontext/index.html @@ -61,11 +61,11 @@

Examples

Basic audio context declaration:

-
var audioCtx = new AudioContext();
+
var audioCtx = new AudioContext();

Cross browser variant:

-
var AudioContext = window.AudioContext || window.webkitAudioContext;
+
var AudioContext = window.AudioContext || window.webkitAudioContext;
 var audioCtx = new AudioContext();
 
 var oscillatorNode = audioCtx.createOscillator();
diff --git a/files/en-us/web/api/audiocontext/outputlatency/index.html b/files/en-us/web/api/audiocontext/outputlatency/index.html
index baebaea5bb9fa51..f5dd448412b164c 100644
--- a/files/en-us/web/api/audiocontext/outputlatency/index.html
+++ b/files/en-us/web/api/audiocontext/outputlatency/index.html
@@ -24,7 +24,7 @@
 
 

Syntax

-
var outputLatency = audioCtx.outputLatency;
+
var outputLatency = audioCtx.outputLatency;
 

Value

@@ -33,7 +33,7 @@

Value

Example

-
const audioCtx = new AudioContext();
+
const audioCtx = new AudioContext();
 console.log(audioCtx.outputLatency);

Specifications

diff --git a/files/en-us/web/api/audiocontext/resume/index.html b/files/en-us/web/api/audiocontext/resume/index.html index a6e20bd8d2e3ea9..ac99c2da44719b2 100644 --- a/files/en-us/web/api/audiocontext/resume/index.html +++ b/files/en-us/web/api/audiocontext/resume/index.html @@ -21,7 +21,7 @@

Syntax

-
completePromise = audioContext.resume();
+
completePromise = audioContext.resume();
 

Parameters

diff --git a/files/en-us/web/api/audiocontext/suspend/index.html b/files/en-us/web/api/audiocontext/suspend/index.html index 90f9270553427f7..556d0eced5ad22a 100644 --- a/files/en-us/web/api/audiocontext/suspend/index.html +++ b/files/en-us/web/api/audiocontext/suspend/index.html @@ -18,7 +18,7 @@

Syntax

-
var audioCtx = new AudioContext();
+
var audioCtx = new AudioContext();
 audioCtx.suspend().then(function() { ... });
 
@@ -30,7 +30,7 @@

Example

The following snippet is taken from our AudioContext states demo (see it running live.) When the suspend/resume button is clicked, the {{domxref("BaseAudioContext/state", "AudioContext.state")}} is queried — if it is running, suspend() is called; if it is suspended, {{domxref("AudioContext/resume", "resume()")}} is called. In each case, the text label of the button is updated as appropriate once the promise resolves.

-
susresBtn.onclick = function() {
+
susresBtn.onclick = function() {
   if(audioCtx.state === 'running') {
     audioCtx.suspend().then(function() {
       susresBtn.textContent = 'Resume context';
diff --git a/files/en-us/web/api/audiocontextoptions/latencyhint/index.html b/files/en-us/web/api/audiocontextoptions/latencyhint/index.html
index 109e7da5acae5f8..9efad2a4264e90e 100644
--- a/files/en-us/web/api/audiocontextoptions/latencyhint/index.html
+++ b/files/en-us/web/api/audiocontextoptions/latencyhint/index.html
@@ -27,7 +27,7 @@
 
 

Syntax

-
audioContextOptions.latencyHint = "interactive";
+
audioContextOptions.latencyHint = "interactive";
 audioContextOptions.latencyHint = 0.2;
 
 var latencyHint = audioContextOptions.latencyHint;
diff --git a/files/en-us/web/api/audiocontextoptions/samplerate/index.html b/files/en-us/web/api/audiocontextoptions/samplerate/index.html index 789b52f8398bf5a..17ee7d5a742e713 100644 --- a/files/en-us/web/api/audiocontextoptions/samplerate/index.html +++ b/files/en-us/web/api/audiocontextoptions/samplerate/index.html @@ -27,7 +27,7 @@

Syntax

-
audioContextOptions.sampleRate = 44100;
+
audioContextOptions.sampleRate = 44100;
 
 var sampleRate = audioContextOptions.sampleRate;
diff --git a/files/en-us/web/api/audiodestinationnode/index.html b/files/en-us/web/api/audiodestinationnode/index.html index 17394c564c3fd6d..abc8ed1afbbe8d9 100644 --- a/files/en-us/web/api/audiodestinationnode/index.html +++ b/files/en-us/web/api/audiodestinationnode/index.html @@ -58,7 +58,7 @@

Example

There is no complex set up for using an AudioDestinationNode — by default, this represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code:

-
var audioCtx = new AudioContext();
+
var audioCtx = new AudioContext();
 var source = audioCtx.createMediaElementSource(myMediaElement);
 source.connect(gainNode);
 gainNode.connect(audioCtx.destination);
diff --git a/files/en-us/web/api/backgroundfetchmanager/fetch/index.html b/files/en-us/web/api/backgroundfetchmanager/fetch/index.html index c6eef5c2fbc394b..7dfaf6b3c343086 100644 --- a/files/en-us/web/api/backgroundfetchmanager/fetch/index.html +++ b/files/en-us/web/api/backgroundfetchmanager/fetch/index.html @@ -17,7 +17,7 @@

Syntax

-
var backgroundFetchRegistration = BackgroundFetchManager.fetch();
+
var backgroundFetchRegistration = BackgroundFetchManager.fetch();

Parameters

diff --git a/files/en-us/web/api/backgroundfetchmanager/get/index.html b/files/en-us/web/api/backgroundfetchmanager/get/index.html index 712a56f27ec5bf7..abe1cc45955806f 100644 --- a/files/en-us/web/api/backgroundfetchmanager/get/index.html +++ b/files/en-us/web/api/backgroundfetchmanager/get/index.html @@ -17,7 +17,7 @@

Syntax

-
var backgroundFetchRegistration = BackgroundFetchManager.get();
+
var backgroundFetchRegistration = BackgroundFetchManager.get();

Parameters

diff --git a/files/en-us/web/api/backgroundfetchmanager/getids/index.html b/files/en-us/web/api/backgroundfetchmanager/getids/index.html index db9e8bc6d92f1bc..dc4741e3dba2353 100644 --- a/files/en-us/web/api/backgroundfetchmanager/getids/index.html +++ b/files/en-us/web/api/backgroundfetchmanager/getids/index.html @@ -17,7 +17,7 @@

Syntax

-
var stringArray = BackgroundFetchManager.getIds();
+
var stringArray = BackgroundFetchManager.getIds();

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/audioworklet/index.html b/files/en-us/web/api/baseaudiocontext/audioworklet/index.html index 81eb0979b34d1b7..67508902676b04d 100644 --- a/files/en-us/web/api/baseaudiocontext/audioworklet/index.html +++ b/files/en-us/web/api/baseaudiocontext/audioworklet/index.html @@ -22,7 +22,7 @@

Syntax

-
baseAudioContextInstance.audioWorklet;
+
baseAudioContextInstance.audioWorklet;
 

Value

diff --git a/files/en-us/web/api/baseaudiocontext/createanalyser/index.html b/files/en-us/web/api/baseaudiocontext/createanalyser/index.html index 8b5ab50429ada7e..fc5e1a7b771aa74 100644 --- a/files/en-us/web/api/baseaudiocontext/createanalyser/index.html +++ b/files/en-us/web/api/baseaudiocontext/createanalyser/index.html @@ -24,7 +24,7 @@

Syntax

var analyserNode = baseAudioContext.createAnalyser();
+ class="brush: js">var analyserNode = baseAudioContext.createAnalyser();

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html b/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html index be8ac88b1b9a94e..6f2f22bbda0758f 100644 --- a/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html +++ b/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html @@ -20,7 +20,7 @@

Syntax

-
baseAudioContext.createBiquadFilter();
+
baseAudioContext.createBiquadFilter();

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/createbuffer/index.html b/files/en-us/web/api/baseaudiocontext/createbuffer/index.html index 49f4893ad3138d7..c2595448d7e371e 100644 --- a/files/en-us/web/api/baseaudiocontext/createbuffer/index.html +++ b/files/en-us/web/api/baseaudiocontext/createbuffer/index.html @@ -38,7 +38,7 @@

Syntax

var buffer = baseAudioContext.createBuffer(numOfchannels, length, sampleRate);
+ class="brush: js">var buffer = baseAudioContext.createBuffer(numOfchannels, length, sampleRate);

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html b/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html index f2ef5a5652d11e4..62f513b2fd81c3d 100644 --- a/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html +++ b/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html @@ -25,7 +25,7 @@

Syntax

var source = baseAudioContext.createBufferSource();
+ class="brush: js">var source = baseAudioContext.createBufferSource();

Returns

@@ -45,7 +45,7 @@

Example

the source.

-
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
+
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
 var button = document.querySelector('button');
 var pre = document.querySelector('pre');
 var myScript = document.querySelector('script');
diff --git a/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html b/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html
index ead9d48cbf3fa71..dad134b9926ccd0 100644
--- a/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html
+++ b/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html
@@ -20,7 +20,7 @@
 

Syntax

baseAudioContext.createChannelMerger(numberOfInputs);
+ class="brush: js">baseAudioContext.createChannelMerger(numberOfInputs);

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html b/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html index d6ed94b3c199968..c3feb472ecc0fd6 100644 --- a/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html +++ b/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html @@ -21,7 +21,7 @@

Syntax

baseAudioContext.createChannelSplitter(numberOfOutputs);
+ class="brush: js">baseAudioContext.createChannelSplitter(numberOfOutputs);

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html b/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html index 3bede4ea1317708..20f7c7953116792 100644 --- a/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html +++ b/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html @@ -22,7 +22,7 @@

Syntax

var constantSourceNode = AudioContext.createConstantSource()
+ class="brush: js">var constantSourceNode = AudioContext.createConstantSource()

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createconvolver/index.html b/files/en-us/web/api/baseaudiocontext/createconvolver/index.html index 4009124ba799b13..9e873a973dcbce1 100644 --- a/files/en-us/web/api/baseaudiocontext/createconvolver/index.html +++ b/files/en-us/web/api/baseaudiocontext/createconvolver/index.html @@ -22,7 +22,7 @@

Syntax

-
baseAudioContext.createConvolver();
+
baseAudioContext.createConvolver();

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/createdelay/index.html b/files/en-us/web/api/baseaudiocontext/createdelay/index.html index 78b469f37c03184..8d4c55f363a29a0 100644 --- a/files/en-us/web/api/baseaudiocontext/createdelay/index.html +++ b/files/en-us/web/api/baseaudiocontext/createdelay/index.html @@ -19,7 +19,7 @@

Syntax

var delayNode = audioCtx.createDelay(maxDelayTime);
+ class="brush: js">var delayNode = audioCtx.createDelay(maxDelayTime);

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html b/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html index 6bd3b261854b991..7e3f9ed01fee100 100644 --- a/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html +++ b/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html @@ -27,7 +27,7 @@

Syntax

-
baseAudioCtx.createDynamicsCompressor();
+
baseAudioCtx.createDynamicsCompressor();

Returns

@@ -42,7 +42,7 @@

Example

href="https://github.com/mdn/webaudio-examples/tree/master/compressor-example">view the source code).

-
// Create a MediaElementAudioSourceNode
+
// Create a MediaElementAudioSourceNode
 // Feed the HTMLMediaElement into it
 var source = audioCtx.createMediaElementSource(myAudio);
 
diff --git a/files/en-us/web/api/baseaudiocontext/creategain/index.html b/files/en-us/web/api/baseaudiocontext/creategain/index.html
index bdd2124183c4120..017ba28bb3da713 100644
--- a/files/en-us/web/api/baseaudiocontext/creategain/index.html
+++ b/files/en-us/web/api/baseaudiocontext/creategain/index.html
@@ -22,7 +22,7 @@
 

Syntax

var gainNode = AudioContext.createGain();
+ class="brush: js">var gainNode = AudioContext.createGain();

Return value

@@ -42,11 +42,11 @@

Example

href="https://github.com/mdn/voice-change-o-matic/blob/gh-pages/scripts/app.js">view source.)

-
<div>
+
<div>
   <button class="mute">Mute button</button>
 </div>
-
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
+
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
 var gainNode = audioCtx.createGain();
 var mute = document.querySelector('.mute');
 var source;
diff --git a/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html b/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html
index 8abe689b7c41080..0d34fd9c67053be 100644
--- a/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html
+++ b/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html
@@ -23,7 +23,7 @@
 

Syntax

var iirFilter = AudioContext.createIIRFilter(feedforward, feedback);
+ class="brush: js">var iirFilter = AudioContext.createIIRFilter(feedforward, feedback);

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createoscillator/index.html b/files/en-us/web/api/baseaudiocontext/createoscillator/index.html index 2ae65e7fa508720..88f7eb39412a0a6 100644 --- a/files/en-us/web/api/baseaudiocontext/createoscillator/index.html +++ b/files/en-us/web/api/baseaudiocontext/createoscillator/index.html @@ -19,7 +19,7 @@

Syntax

var oscillatorNode = audioCtx.createOscillator();
+ class="brush: js">var oscillatorNode = audioCtx.createOscillator();

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/createpanner/index.html b/files/en-us/web/api/baseaudiocontext/createpanner/index.html index 64ef265dff602eb..a67711c2d346f5f 100644 --- a/files/en-us/web/api/baseaudiocontext/createpanner/index.html +++ b/files/en-us/web/api/baseaudiocontext/createpanner/index.html @@ -23,7 +23,7 @@

Syntax

-
baseAudioCtx.createPanner();
+
baseAudioCtx.createPanner();

Returns

@@ -55,7 +55,7 @@

Example

{{domxref("AudioListener.setOrientation()")}}) if it still supports those but not the new properties.

-
// set up listener and panner position information
+
// set up listener and panner position information
 var WIDTH = window.innerWidth;
 var HEIGHT = window.innerHeight;
 
diff --git a/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html b/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html
index 2469981f8df72ec..37a0f38bbf8f79b 100644
--- a/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html
+++ b/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html
@@ -21,7 +21,7 @@
 

Syntax

var wave = AudioContext.createPeriodicWave(real, imag[, constraints]);
+ class="brush: js">var wave = AudioContext.createPeriodicWave(real, imag[, constraints]);

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html b/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html index 92796a7b9c213fa..c26a2dbed07d3af 100644 --- a/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html +++ b/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html @@ -25,7 +25,7 @@

Syntax

var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels);
+ class="brush: js">var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels);

Parameters

diff --git a/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html b/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html index f0edfd4debf3c33..15cb157712b31ea 100644 --- a/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html +++ b/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html @@ -22,7 +22,7 @@

Syntax

-
baseAudioContext.createStereoPanner();
+
baseAudioContext.createStereoPanner();

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html b/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html index 1fe4dc695a68d1b..dc08b7186014432 100644 --- a/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html +++ b/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html @@ -20,7 +20,7 @@

Syntax

-
baseAudioCtx.createWaveShaper();
+
baseAudioCtx.createWaveShaper();

Returns

diff --git a/files/en-us/web/api/baseaudiocontext/currenttime/index.html b/files/en-us/web/api/baseaudiocontext/currenttime/index.html index 8dc6ca618ae1063..526cdbcbc58eb03 100644 --- a/files/en-us/web/api/baseaudiocontext/currenttime/index.html +++ b/files/en-us/web/api/baseaudiocontext/currenttime/index.html @@ -18,7 +18,7 @@

Syntax

-
var curTime = baseAudioContext.currentTime;
+
var curTime = baseAudioContext.currentTime;
 

Example

diff --git a/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html b/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html index 376721870f44e36..5a98a56898f348d 100644 --- a/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html +++ b/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html @@ -29,12 +29,12 @@

Syntax

Older callback syntax:

baseAudioContext.decodeAudioData(ArrayBuffer, successCallback, errorCallback);
+ class="brush: js">baseAudioContext.decodeAudioData(ArrayBuffer, successCallback, errorCallback);

Newer promise-based syntax:

Promise<decodedData> baseAudioContext.decodeAudioData(ArrayBuffer);
+ class="brush: js">Promise<decodedData> baseAudioContext.decodeAudioData(ArrayBuffer);

Parameters

@@ -87,7 +87,7 @@

Older callback syntax

the source.)

-
// define variables
+
// define variables
 
 var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
 var source;
@@ -145,7 +145,7 @@ 

Older callback syntax

New promise-based syntax

-
ctx.decodeAudioData(audioData).then(function(decodedData) {
+
ctx.decodeAudioData(audioData).then(function(decodedData) {
  // use the decoded data here
 });
diff --git a/files/en-us/web/api/baseaudiocontext/destination/index.html b/files/en-us/web/api/baseaudiocontext/destination/index.html index 8c6130865e6963f..c653453433ac315 100644 --- a/files/en-us/web/api/baseaudiocontext/destination/index.html +++ b/files/en-us/web/api/baseaudiocontext/destination/index.html @@ -19,7 +19,7 @@

Syntax

-
baseAudioContext.destination;
+
baseAudioContext.destination;
 

Value

diff --git a/files/en-us/web/api/baseaudiocontext/listener/index.html b/files/en-us/web/api/baseaudiocontext/listener/index.html index 62b09e6fb6a40c3..826b50c8781afd1 100644 --- a/files/en-us/web/api/baseaudiocontext/listener/index.html +++ b/files/en-us/web/api/baseaudiocontext/listener/index.html @@ -19,7 +19,7 @@

Syntax

-
baseAudioContext.listener;
+
baseAudioContext.listener;
 

Value

diff --git a/files/en-us/web/api/baseaudiocontext/onstatechange/index.html b/files/en-us/web/api/baseaudiocontext/onstatechange/index.html index dc756ac1612ca3f..7446020f87256ad 100644 --- a/files/en-us/web/api/baseaudiocontext/onstatechange/index.html +++ b/files/en-us/web/api/baseaudiocontext/onstatechange/index.html @@ -23,7 +23,7 @@

Syntax

baseAudioContext.onstatechange = function() { ... };
+ class="brush: js">baseAudioContext.onstatechange = function() { ... };

Example

@@ -33,7 +33,7 @@

Example

live.) The onstatechange handler is used to log the current {{domxref("BaseAudioContext.state", "state")}} to the console every time it changes.

-
audioCtx.onstatechange = function() {
+
audioCtx.onstatechange = function() {
   console.log(audioCtx.state);
 }
 
diff --git a/files/en-us/web/api/baseaudiocontext/samplerate/index.html b/files/en-us/web/api/baseaudiocontext/samplerate/index.html index 5908509b0133daf..a986ad829fe477c 100644 --- a/files/en-us/web/api/baseaudiocontext/samplerate/index.html +++ b/files/en-us/web/api/baseaudiocontext/samplerate/index.html @@ -20,7 +20,7 @@

Syntax

-
baseAudioContext.sampleRate;
+
baseAudioContext.sampleRate;
 

Value

diff --git a/files/en-us/web/api/baseaudiocontext/state/index.html b/files/en-us/web/api/baseaudiocontext/state/index.html index b1aead69a0dcb30..bbde534668ddd63 100644 --- a/files/en-us/web/api/baseaudiocontext/state/index.html +++ b/files/en-us/web/api/baseaudiocontext/state/index.html @@ -20,7 +20,7 @@

Syntax

-
baseAudioContext.state;
+
baseAudioContext.state;

Value

diff --git a/files/en-us/web/api/bluetooth/getavailability/index.html b/files/en-us/web/api/bluetooth/getavailability/index.html index 850e44d1f877077..ac6cd40938f21cf 100644 --- a/files/en-us/web/api/bluetooth/getavailability/index.html +++ b/files/en-us/web/api/bluetooth/getavailability/index.html @@ -27,7 +27,7 @@

Syntax

-
var readerPromise = Bluetooth.getAvailability();
+
var readerPromise = Bluetooth.getAvailability();
 

Parameters

@@ -47,7 +47,7 @@

Examples

The following snippet prints out a message in the console specifying whether or not Bluetooth is supported:

-
navigator.bluetooth.getAvailability().then(available => {
+
navigator.bluetooth.getAvailability().then(available => {
   if (available)
       console.log("This device supports Bluetooth!");
   else
diff --git a/files/en-us/web/api/bluetooth/getdevices/index.html b/files/en-us/web/api/bluetooth/getdevices/index.html
index ad3a88407d5efa1..34ffb97e4618b93 100644
--- a/files/en-us/web/api/bluetooth/getdevices/index.html
+++ b/files/en-us/web/api/bluetooth/getdevices/index.html
@@ -26,7 +26,7 @@
 
 

Syntax

-
var readerPromise = Bluetooth.getDevices();
+
var readerPromise = Bluetooth.getDevices();
 

Parameters

diff --git a/files/en-us/web/api/bluetooth/index.html b/files/en-us/web/api/bluetooth/index.html index 87e523e41dd2670..d0af954339aed4b 100644 --- a/files/en-us/web/api/bluetooth/index.html +++ b/files/en-us/web/api/bluetooth/index.html @@ -18,7 +18,7 @@

Interface

-
interface Bluetooth : EventTarget {
+
interface Bluetooth : EventTarget {
   Promise<boolean> getAvailability();
   attribute EventHandler onavailabilitychanged;
   [SameObject]
diff --git a/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html b/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html
index 31a577e3d7cfa02..6d4c38f7329cc2f 100644
--- a/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html
+++ b/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html
@@ -16,7 +16,7 @@
 
 

Syntax

-
Bluetooth.onavailabilitychanged = functionRef;
+
Bluetooth.onavailabilitychanged = functionRef;
 

Value

diff --git a/files/en-us/web/api/bluetooth/referringdevice/index.html b/files/en-us/web/api/bluetooth/referringdevice/index.html index 2786277e0d726a0..186284bb199acf0 100644 --- a/files/en-us/web/api/bluetooth/referringdevice/index.html +++ b/files/en-us/web/api/bluetooth/referringdevice/index.html @@ -16,7 +16,7 @@

Syntax

-
Bluetooth.referringDevice
+
Bluetooth.referringDevice

Value

diff --git a/files/en-us/web/api/bluetooth/requestdevice/index.html b/files/en-us/web/api/bluetooth/requestdevice/index.html index 31b680932ed6bed..82a88d94d76aef7 100644 --- a/files/en-us/web/api/bluetooth/requestdevice/index.html +++ b/files/en-us/web/api/bluetooth/requestdevice/index.html @@ -18,7 +18,7 @@

Syntax

-
Bluetooth.requestDevice([options])
+
Bluetooth.requestDevice([options])
   .then(function(bluetoothDevice) { ... })

Returns

diff --git a/files/en-us/web/api/bluetoothremotegattserver/connect/index.html b/files/en-us/web/api/bluetoothremotegattserver/connect/index.html index 85eca0784f808e7..17f216d754ebe04 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/connect/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/connect/index.html @@ -19,7 +19,7 @@

Syntax

-
BluetoothRemoteGATTServer.connect()
+
BluetoothRemoteGATTServer.connect()
   .then(function(bluetoothRemoteGATTServer) { ... })

Returns

diff --git a/files/en-us/web/api/bluetoothremotegattserver/connected/index.html b/files/en-us/web/api/bluetoothremotegattserver/connected/index.html index e0d33ad66b2a9ae..9bccc94bf7363f8 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/connected/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/connected/index.html @@ -20,7 +20,7 @@

Syntax

var connected = BluetoothRemoteGATTServer.connected
+ class="brush: js">var connected = BluetoothRemoteGATTServer.connected

Specifications

diff --git a/files/en-us/web/api/bluetoothremotegattserver/device/index.html b/files/en-us/web/api/bluetoothremotegattserver/device/index.html index 2e935443f230062..3ed9b6ad63fa2e2 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/device/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/device/index.html @@ -17,7 +17,7 @@

Syntax

var device = BluetoothRemoteGATTServer.device
+ class="brush: js">var device = BluetoothRemoteGATTServer.device

Specifications

diff --git a/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html b/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html index de266a1c569bf9d..a1ee03b2a293b8e 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html @@ -18,7 +18,7 @@

Syntax

-
BluetoothRemoteGATTServer.disconnect()
+
BluetoothRemoteGATTServer.disconnect()

Returns

diff --git a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html index ef614fb1d59153e..c1bb4040f153612 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html @@ -20,7 +20,7 @@

Syntax

BluetoothRemoteGATTServer.getPrimaryService(bluetoothServiceUUID).then(function(bluetoothGATTService) { ... })
+ class="brush: js">BluetoothRemoteGATTServer.getPrimaryService(bluetoothServiceUUID).then(function(bluetoothGATTService) { ... })

Returns

diff --git a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html index 33d9a1d6d078d0d..2f061daba328b72 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html @@ -20,7 +20,7 @@

Syntax

BluetoothRemoteGATTServer.getPrimaryServices(bluetoothServiceUUID).then(function(bluetoothGATTServices) { ... })
+ class="brush: js">BluetoothRemoteGATTServer.getPrimaryServices(bluetoothServiceUUID).then(function(bluetoothGATTServices) { ... })

Returns

diff --git a/files/en-us/web/api/bluetoothremotegattserver/index.html b/files/en-us/web/api/bluetoothremotegattserver/index.html index d653309784562c1..fccea40e9e77c9f 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/index.html @@ -25,7 +25,7 @@

Interface

-
interface BluetoothRemoteGATTServer {
+
interface BluetoothRemoteGATTServer {
   readonly attribute BluetoothDevice device;
   readonly attribute boolean connected;
 
diff --git a/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html b/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html
index e76ab6d9ebd7b53..19b4aca893a017d 100644
--- a/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html
+++ b/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html
@@ -20,7 +20,7 @@
 

Syntax

 channel = new BroadcastChannel(channel);
+ class="brush: js"> channel = new BroadcastChannel(channel);

Values

diff --git a/files/en-us/web/api/broadcastchannel/close/index.html b/files/en-us/web/api/broadcastchannel/close/index.html index 05d153a89df4511..3c29932beac06bb 100644 --- a/files/en-us/web/api/broadcastchannel/close/index.html +++ b/files/en-us/web/api/broadcastchannel/close/index.html @@ -21,7 +21,7 @@

Syntax

-
var str = channel.close();
+
var str = channel.close();
 

Example

diff --git a/files/en-us/web/api/broadcastchannel/message_event/index.html b/files/en-us/web/api/broadcastchannel/message_event/index.html index c258e8f6007e446..16e88a2f16db360 100644 --- a/files/en-us/web/api/broadcastchannel/message_event/index.html +++ b/files/en-us/web/api/broadcastchannel/message_event/index.html @@ -43,12 +43,12 @@

Live example

Sender

-
const channel = new BroadcastChannel('example-channel');
+
const channel = new BroadcastChannel('example-channel');
 const messageControl = document.querySelector('#message');
 const broadcastMessageButton = document.querySelector('#broadcast-message');
 
@@ -86,10 +86,10 @@ 

Sender

Receiver 1

-
const channel = new BroadcastChannel('example-channel');
+
const channel = new BroadcastChannel('example-channel');
 channel.addEventListener('message', (event) => {
   received.textContent = event.data;
 });
@@ -111,10 +111,10 @@

Receiver 1

Receiver 2

-
const channel = new BroadcastChannel('example-channel');
+
const channel = new BroadcastChannel('example-channel');
 channel.addEventListener('message', (event) => {
   received.textContent = event.data;
 });
diff --git a/files/en-us/web/api/broadcastchannel/name/index.html b/files/en-us/web/api/broadcastchannel/name/index.html index 675e4b8e15ba440..f2201ab3986623b 100644 --- a/files/en-us/web/api/broadcastchannel/name/index.html +++ b/files/en-us/web/api/broadcastchannel/name/index.html @@ -21,7 +21,7 @@

Syntax

-
var str = channel.name;
+
var str = channel.name;
 

Examples

diff --git a/files/en-us/web/api/broadcastchannel/onmessage/index.html b/files/en-us/web/api/broadcastchannel/onmessage/index.html index f23a16eae2b2d98..740500df142e057 100644 --- a/files/en-us/web/api/broadcastchannel/onmessage/index.html +++ b/files/en-us/web/api/broadcastchannel/onmessage/index.html @@ -22,7 +22,7 @@

Syntax

-
channel.onmessage = function;
+
channel.onmessage = function;
 

Values

diff --git a/files/en-us/web/api/broadcastchannel/onmessageerror/index.html b/files/en-us/web/api/broadcastchannel/onmessageerror/index.html index 6e7435e275209a9..f8de2a1d3bfa4c2 100644 --- a/files/en-us/web/api/broadcastchannel/onmessageerror/index.html +++ b/files/en-us/web/api/broadcastchannel/onmessageerror/index.html @@ -21,7 +21,7 @@

Syntax

-
bc.onmessageerror = function() { ... };
+
bc.onmessageerror = function() { ... };

Specifications

diff --git a/files/en-us/web/api/broadcastchannel/postmessage/index.html b/files/en-us/web/api/broadcastchannel/postmessage/index.html index 17f561d6c6fdc90..a8240953e89191c 100644 --- a/files/en-us/web/api/broadcastchannel/postmessage/index.html +++ b/files/en-us/web/api/broadcastchannel/postmessage/index.html @@ -22,7 +22,7 @@

Syntax

-
var str = channel.postMessage(object);
+
var str = channel.postMessage(object);
 

Specifications

diff --git a/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html b/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html index 08d5a90e7078a96..dabd1018c77a100 100644 --- a/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html +++ b/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html @@ -18,7 +18,7 @@

Syntax

var byteLengthQueuingStrategy = new ByteLengthQueuingStrategy({highWaterMark});
+ class="brush: js">var byteLengthQueuingStrategy = new ByteLengthQueuingStrategy({highWaterMark});

Parameters

diff --git a/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html b/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html index 1802ea976a83189..1945265ac31244a 100644 --- a/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html +++ b/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html @@ -19,7 +19,7 @@

Syntax

var size = byteLengthQueuingStrategy.size(chunk);
+ class="brush: js">var size = byteLengthQueuingStrategy.size(chunk);

Parameters

diff --git a/files/en-us/web/api/childnode/after/index.html b/files/en-us/web/api/childnode/after/index.html index f6716a5e14e8ece..a0ed1aeea9ce48e 100644 --- a/files/en-us/web/api/childnode/after/index.html +++ b/files/en-us/web/api/childnode/after/index.html @@ -18,7 +18,7 @@

Syntax

-
[Throws, Unscopable]
+
[Throws, Unscopable]
 void ChildNode.after((Node or DOMString)... nodes);
 
diff --git a/files/en-us/web/api/childnode/before/index.html b/files/en-us/web/api/childnode/before/index.html index 55364cd1fa3040e..ccbaaf135e2a523 100644 --- a/files/en-us/web/api/childnode/before/index.html +++ b/files/en-us/web/api/childnode/before/index.html @@ -18,7 +18,7 @@

Syntax

-
[Throws, Unscopable]
+
[Throws, Unscopable]
 void ChildNode.before((Node or DOMString)... nodes);
 
diff --git a/files/en-us/web/api/childnode/remove/index.html b/files/en-us/web/api/childnode/remove/index.html index 1756830ce1edd85..7606eaccd2aecef 100644 --- a/files/en-us/web/api/childnode/remove/index.html +++ b/files/en-us/web/api/childnode/remove/index.html @@ -15,19 +15,19 @@

Syntax

-
node.remove();
+
node.remove();
 

Example

Using remove()

-
<div id="div-01">Here is div-01</div>
+
<div id="div-01">Here is div-01</div>
 <div id="div-02">Here is div-02</div>
 <div id="div-03">Here is div-03</div>
 
-
var el = document.getElementById('div-02');
+
var el = document.getElementById('div-02');
 el.remove(); // Removes the div with the 'div-02' id
 
@@ -36,7 +36,7 @@

ChildNode.remove() is unsco

The remove() method is not scoped into the with statement. See {{jsxref("Symbol.unscopables")}} for more information.

-
with(node) {
+
with(node) {
   remove();
 }
 // ReferenceError: remove is not defined 
@@ -46,7 +46,7 @@

Polyfill

You can polyfill the remove() method in Internet Explorer 9 and higher with the following code:

-
// from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
+
// from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
 (function (arr) {
   arr.forEach(function (item) {
     if (item.hasOwnProperty('remove')) {
diff --git a/files/en-us/web/api/childnode/replacewith/index.html b/files/en-us/web/api/childnode/replacewith/index.html
index b648d9902be1359..d53c39b717ec550 100644
--- a/files/en-us/web/api/childnode/replacewith/index.html
+++ b/files/en-us/web/api/childnode/replacewith/index.html
@@ -17,7 +17,7 @@
 
 

Syntax

-
[Throws, Unscopable]
+
[Throws, Unscopable]
 void ChildNode.replaceWith((Node or DOMString)... nodes);
 
@@ -39,7 +39,7 @@

Examples

Using replaceWith()

-
var parent = document.createElement("div");
+
var parent = document.createElement("div");
 var child = document.createElement("p");
 parent.appendChild(child);
 var span = document.createElement("span");
@@ -56,7 +56,7 @@ 

ChildNode.replaceWith()The replaceWith() method is not scoped into the with statement. See {{jsxref("Symbol.unscopables")}} for more information.

-
with(node) {
+
with(node) {
   replaceWith("foo");
 }
 // ReferenceError: replaceWith is not defined 
@@ -66,7 +66,7 @@

Polyfill

You can polyfill the replaceWith() method in Internet Explorer 10+ and higher with the following code:

-
function ReplaceWithPolyfill() {
+
function ReplaceWithPolyfill() {
   'use-strict'; // For safari, and IE > 10
   var parent = this.parentNode, i = arguments.length, currentNode;
   if (!parent) return;
diff --git a/files/en-us/web/api/clipboardevent/clipboarddata/index.html b/files/en-us/web/api/clipboardevent/clipboarddata/index.html
index e663ca211eb4768..bd927659ebfc8da 100644
--- a/files/en-us/web/api/clipboardevent/clipboarddata/index.html
+++ b/files/en-us/web/api/clipboardevent/clipboarddata/index.html
@@ -32,7 +32,7 @@
 

Syntax

data = ClipboardEvent.clipboardData
+ class="brush: js">data = ClipboardEvent.clipboardData

Specifications

diff --git a/files/en-us/web/api/clipboardevent/clipboardevent/index.html b/files/en-us/web/api/clipboardevent/clipboardevent/index.html index 5957673a4c65672..17f6e896cf7e356 100644 --- a/files/en-us/web/api/clipboardevent/clipboardevent/index.html +++ b/files/en-us/web/api/clipboardevent/clipboardevent/index.html @@ -22,7 +22,7 @@

Syntax

-
var clipboardEvent = new ClipboardEvent(type[, options]);
+
var clipboardEvent = new ClipboardEvent(type[, options]);
 

Parameters

diff --git a/files/en-us/web/api/console_api/index.html b/files/en-us/web/api/console_api/index.html index f470b5d6404a42b..4de93687f7e8953 100644 --- a/files/en-us/web/api/console_api/index.html +++ b/files/en-us/web/api/console_api/index.html @@ -39,7 +39,7 @@

Interfaces

Examples

-
let myString = 'Hello world';
+
let myString = 'Hello world';
 
 // Output "Hello world" to the console
 console.log(myString)
diff --git a/files/en-us/web/api/credentialscontainer/create/index.html b/files/en-us/web/api/credentialscontainer/create/index.html index 42bbef9d15eed49..f6639c5817bc8b7 100644 --- a/files/en-us/web/api/credentialscontainer/create/index.html +++ b/files/en-us/web/api/credentialscontainer/create/index.html @@ -24,7 +24,7 @@

Syntax

var promise = CredentialsContainer.create([options])
+ class="brush: js">var promise = CredentialsContainer.create([options])

Parameters

diff --git a/files/en-us/web/api/credentialscontainer/get/index.html b/files/en-us/web/api/credentialscontainer/get/index.html index f9b06e7f42ad188..ce68c2aae3921b2 100644 --- a/files/en-us/web/api/credentialscontainer/get/index.html +++ b/files/en-us/web/api/credentialscontainer/get/index.html @@ -35,7 +35,7 @@

Syntax

-
var promise = CredentialsContainer.get([options])
+
var promise = CredentialsContainer.get([options])

Parameters

diff --git a/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html b/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html index 5057d03076ff567..07017aedd4eb931 100644 --- a/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html +++ b/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html @@ -31,7 +31,7 @@

Syntax

var Promise = CredentialsContainer.preventSilentAccess()
+ class="brush: js">var Promise = CredentialsContainer.preventSilentAccess()

Parameters

diff --git a/files/en-us/web/api/credentialscontainer/store/index.html b/files/en-us/web/api/credentialscontainer/store/index.html index 5b6045b49c4a8b0..4ca5f4861dfce0f 100644 --- a/files/en-us/web/api/credentialscontainer/store/index.html +++ b/files/en-us/web/api/credentialscontainer/store/index.html @@ -25,7 +25,7 @@

Syntax

CredentialsContainer.store(Credential).then(function(Credential) { ... } )
+ class="brush: js">CredentialsContainer.store(Credential).then(function(Credential) { ... } )

Parameters

@@ -47,7 +47,7 @@

Storing a pa

This code would be executed after a user signs up or logs in and the server confirms the credential is correct.

-
// Check if the browser supports password credentials (and the Credential Management API)
+
// Check if the browser supports password credentials (and the Credential Management API)
 if ("PasswordCredential" in window) {
   let credential = new PasswordCredential({
     id: "example-username",
diff --git a/files/en-us/web/api/csskeyframesrule/appendrule/index.html b/files/en-us/web/api/csskeyframesrule/appendrule/index.html
index 3cd3f03df48f0b9..c4795a5b29c5700 100644
--- a/files/en-us/web/api/csskeyframesrule/appendrule/index.html
+++ b/files/en-us/web/api/csskeyframesrule/appendrule/index.html
@@ -15,7 +15,7 @@
 
 

Syntax

-
CSSKeyframesRule.appendRule(rule);
+
CSSKeyframesRule.appendRule(rule);

Parameters

diff --git a/files/en-us/web/api/csskeyframesrule/cssrules/index.html b/files/en-us/web/api/csskeyframesrule/cssrules/index.html index f01ddae3c62f122..954415c490fdb90 100644 --- a/files/en-us/web/api/csskeyframesrule/cssrules/index.html +++ b/files/en-us/web/api/csskeyframesrule/cssrules/index.html @@ -15,7 +15,7 @@

Syntax

-
var cssRules = CSSKeyframesRule.cssRules;
+
var cssRules = CSSKeyframesRule.cssRules;

Value

A {{domxref('CSSRuleList')}}.

diff --git a/files/en-us/web/api/csskeyframesrule/deleterule/index.html b/files/en-us/web/api/csskeyframesrule/deleterule/index.html index 82a2cb97effef6b..4bf9460b6a17308 100644 --- a/files/en-us/web/api/csskeyframesrule/deleterule/index.html +++ b/files/en-us/web/api/csskeyframesrule/deleterule/index.html @@ -15,7 +15,7 @@

Syntax

-
CSSKeyframesRule.deleteRule(select);
+
CSSKeyframesRule.deleteRule(select);

Parameters

diff --git a/files/en-us/web/api/csskeyframesrule/findrule/index.html b/files/en-us/web/api/csskeyframesrule/findrule/index.html index b4bda118606350e..05b3312070dff21 100644 --- a/files/en-us/web/api/csskeyframesrule/findrule/index.html +++ b/files/en-us/web/api/csskeyframesrule/findrule/index.html @@ -15,7 +15,7 @@

Syntax

-
CSSKeyframesRule.findRule(select);
+
CSSKeyframesRule.findRule(select);

Parameters

diff --git a/files/en-us/web/api/csskeyframesrule/name/index.html b/files/en-us/web/api/csskeyframesrule/name/index.html index a47c5e9e8a45a63..7991ec5dfdbdbf1 100644 --- a/files/en-us/web/api/csskeyframesrule/name/index.html +++ b/files/en-us/web/api/csskeyframesrule/name/index.html @@ -15,7 +15,7 @@

Syntax

-
var name = CSSKeyframesRule.name;
+
var name = CSSKeyframesRule.name;
 CSSKeyframesRule.name = name;

Value

diff --git a/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html b/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html index 10398753eb25626..23ac3365bc08bde 100644 --- a/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html +++ b/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html @@ -19,7 +19,7 @@

Syntax

var CSSMathInvert = new CSSMathInvert(arg);
+ class="brush: js">var CSSMathInvert = new CSSMathInvert(arg);

Parameters

diff --git a/files/en-us/web/api/cssmathinvert/value/index.html b/files/en-us/web/api/cssmathinvert/value/index.html index 3856c88cf3ff6d1..63ff92c6fdc0a4c 100644 --- a/files/en-us/web/api/cssmathinvert/value/index.html +++ b/files/en-us/web/api/cssmathinvert/value/index.html @@ -19,7 +19,7 @@

Syntax

var cssNumericValue = CSSMathInvert.value;
+ class="brush: js">var cssNumericValue = CSSMathInvert.value;

Value

diff --git a/files/en-us/web/api/cssmathmin/cssmathmin/index.html b/files/en-us/web/api/cssmathmin/cssmathmin/index.html index 78e1dd80135df2b..9d93c1622143a38 100644 --- a/files/en-us/web/api/cssmathmin/cssmathmin/index.html +++ b/files/en-us/web/api/cssmathmin/cssmathmin/index.html @@ -19,7 +19,7 @@

Syntax

var CSSMathMin = new CSSMathMin(args);
+ class="brush: js">var CSSMathMin = new CSSMathMin(args);

Parameters

diff --git a/files/en-us/web/api/cssmathmin/values/index.html b/files/en-us/web/api/cssmathmin/values/index.html index e835032a272ffc2..354d33848842b52 100644 --- a/files/en-us/web/api/cssmathmin/values/index.html +++ b/files/en-us/web/api/cssmathmin/values/index.html @@ -20,7 +20,7 @@

Syntax

var cssNumericArray = CSSMathMin.values;
+ class="brush: js">var cssNumericArray = CSSMathMin.values;

Value

diff --git a/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html b/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html index 7d8bff36ed6417a..e9e7368edbf9387 100644 --- a/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html +++ b/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html @@ -20,7 +20,7 @@

Syntax

var CSSMathProduct = new CSSMathProduct(args)
+ class="brush: js">var CSSMathProduct = new CSSMathProduct(args)

Parameters

diff --git a/files/en-us/web/api/cssmathproduct/values/index.html b/files/en-us/web/api/cssmathproduct/values/index.html index 8229665c2f06ddd..bbd0c3864acb613 100644 --- a/files/en-us/web/api/cssmathproduct/values/index.html +++ b/files/en-us/web/api/cssmathproduct/values/index.html @@ -22,7 +22,7 @@

Syntax

var cssNumericArray = CSSMathProduct.values;
+ class="brush: js">var cssNumericArray = CSSMathProduct.values;

Value

diff --git a/files/en-us/web/api/cssmediarule/media/index.html b/files/en-us/web/api/cssmediarule/media/index.html index 4801b494b86a4cc..fd97a06c8d707c5 100644 --- a/files/en-us/web/api/cssmediarule/media/index.html +++ b/files/en-us/web/api/cssmediarule/media/index.html @@ -20,7 +20,7 @@

Syntax

var media = CSSMediaRule.media;
+ class="brush: js">var media = CSSMediaRule.media;

Value

a {{domxref("MediaList")}}

diff --git a/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html b/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html index f3b0a1403529311..ec8731da8a50fb1 100644 --- a/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html +++ b/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html @@ -15,7 +15,7 @@

Syntax

-
var namespaceURI = CSSNamespaceRule.namespaceURI
+
var namespaceURI = CSSNamespaceRule.namespaceURI

Returns

diff --git a/files/en-us/web/api/cssnamespacerule/prefix/index.html b/files/en-us/web/api/cssnamespacerule/prefix/index.html index 664367a1e9fc05a..24e29af089060ba 100644 --- a/files/en-us/web/api/cssnamespacerule/prefix/index.html +++ b/files/en-us/web/api/cssnamespacerule/prefix/index.html @@ -15,7 +15,7 @@

Syntax

-
var prefix = CSSNamespaceRule.prefix
+
var prefix = CSSNamespaceRule.prefix

Returns

diff --git a/files/en-us/web/api/cssnumericvalue/div/index.html b/files/en-us/web/api/cssnumericvalue/div/index.html index a1aa501fa37020c..b8bea7a6f6a283c 100644 --- a/files/en-us/web/api/cssnumericvalue/div/index.html +++ b/files/en-us/web/api/cssnumericvalue/div/index.html @@ -20,7 +20,7 @@

Syntax

var cssNumericValue = CSSNumericValue.div(number);
+ class="brush: js">var cssNumericValue = CSSNumericValue.div(number);

Parameters

diff --git a/files/en-us/web/api/cssnumericvalue/mul/index.html b/files/en-us/web/api/cssnumericvalue/mul/index.html index 77ac961024a8ab6..b83de0de154a5eb 100644 --- a/files/en-us/web/api/cssnumericvalue/mul/index.html +++ b/files/en-us/web/api/cssnumericvalue/mul/index.html @@ -20,7 +20,7 @@

Syntax

var cssMathProduct = CSSNumericValue.mul(number);
+ class="brush: js">var cssMathProduct = CSSNumericValue.mul(number);

Parameters

diff --git a/files/en-us/web/api/cssnumericvalue/parse/index.html b/files/en-us/web/api/cssnumericvalue/parse/index.html index c0709b24ab9e1e6..3401e14732c26b5 100644 --- a/files/en-us/web/api/cssnumericvalue/parse/index.html +++ b/files/en-us/web/api/cssnumericvalue/parse/index.html @@ -20,7 +20,7 @@

Syntax

var cssNumericValue = CSSNumericValue.parse(cssText);
+ class="brush: js">var cssNumericValue = CSSNumericValue.parse(cssText);

Parameters

diff --git a/files/en-us/web/api/cssnumericvalue/tosum/index.html b/files/en-us/web/api/cssnumericvalue/tosum/index.html index 06eaabbea0a6a35..e9073efeaac28f6 100644 --- a/files/en-us/web/api/cssnumericvalue/tosum/index.html +++ b/files/en-us/web/api/cssnumericvalue/tosum/index.html @@ -20,7 +20,7 @@

Syntax

var cssMathSum = CSSNumericValue.toSum(units);
+ class="brush: js">var cssMathSum = CSSNumericValue.toSum(units);

Parameters

diff --git a/files/en-us/web/api/cssskew/ax/index.html b/files/en-us/web/api/cssskew/ax/index.html index 7ffd9a03bda3cd0..ba16a87b78403e0 100644 --- a/files/en-us/web/api/cssskew/ax/index.html +++ b/files/en-us/web/api/cssskew/ax/index.html @@ -19,7 +19,7 @@

Syntax

-
var skewax = CSSSkew.ax;
+
var skewax = CSSSkew.ax;

Value

diff --git a/files/en-us/web/api/cssskew/ay/index.html b/files/en-us/web/api/cssskew/ay/index.html index 2e341c150daeb19..0cc5ffb62a56db2 100644 --- a/files/en-us/web/api/cssskew/ay/index.html +++ b/files/en-us/web/api/cssskew/ay/index.html @@ -19,7 +19,7 @@

Syntax

-
var skeway = CSSSkew.ay;
+
var skeway = CSSSkew.ay;

Value

diff --git a/files/en-us/web/api/cssskew/cssskew/index.html b/files/en-us/web/api/cssskew/cssskew/index.html index d8fc84a3a513dad..ae89885513fae33 100644 --- a/files/en-us/web/api/cssskew/cssskew/index.html +++ b/files/en-us/web/api/cssskew/cssskew/index.html @@ -22,7 +22,7 @@

Syntax

var CSSSkew = new CSSSkew(ax, ay);
+ class="brush: js">var CSSSkew = new CSSSkew(ax, ay);

Parameters

diff --git a/files/en-us/web/api/cssstylesheet/addrule/index.html b/files/en-us/web/api/cssstylesheet/addrule/index.html index a5ee42536f9d5b0..77f8f07694ad971 100644 --- a/files/en-us/web/api/cssstylesheet/addrule/index.html +++ b/files/en-us/web/api/cssstylesheet/addrule/index.html @@ -28,7 +28,7 @@

Syntax

var result = cssStyleSheet.addRule(selector, styleBlock, index);
+ class="brush: js">var result = cssStyleSheet.addRule(selector, styleBlock, index);

Parameters

diff --git a/files/en-us/web/api/cssstylesheet/cssrules/index.html b/files/en-us/web/api/cssstylesheet/cssrules/index.html index 97d89216cbd4712..be3bea868c4e7de 100644 --- a/files/en-us/web/api/cssstylesheet/cssrules/index.html +++ b/files/en-us/web/api/cssstylesheet/cssrules/index.html @@ -25,7 +25,7 @@

Syntax

var rules = cssStyleSheet.cssRules;
+ class="brush: js">var rules = cssStyleSheet.cssRules;

Value

diff --git a/files/en-us/web/api/cssstylesheet/deleterule/index.html b/files/en-us/web/api/cssstylesheet/deleterule/index.html index 9f08ddfcb5810d8..7e882bfad5c7eb2 100644 --- a/files/en-us/web/api/cssstylesheet/deleterule/index.html +++ b/files/en-us/web/api/cssstylesheet/deleterule/index.html @@ -25,7 +25,7 @@

Syntax

-
cssStyleSheet.deleteRule(index)
+
cssStyleSheet.deleteRule(index)
 

Parameters

diff --git a/files/en-us/web/api/cssstylesheet/insertrule/index.html b/files/en-us/web/api/cssstylesheet/insertrule/index.html index 3c91602c5de5888..dfab42329eb10c6 100644 --- a/files/en-us/web/api/cssstylesheet/insertrule/index.html +++ b/files/en-us/web/api/cssstylesheet/insertrule/index.html @@ -25,7 +25,7 @@

Syntax

stylesheet.insertRule(rule [, index])
+ class="brush: js">stylesheet.insertRule(rule [, index])

Parameters

diff --git a/files/en-us/web/api/cssstylesheet/ownerrule/index.html b/files/en-us/web/api/cssstylesheet/ownerrule/index.html index 2e27e12e29dad3c..ac211e25e9bec26 100644 --- a/files/en-us/web/api/cssstylesheet/ownerrule/index.html +++ b/files/en-us/web/api/cssstylesheet/ownerrule/index.html @@ -28,7 +28,7 @@

Syntax

var ownerRule = cssStyleSheet.ownerRule;
+ class="brush: js">var ownerRule = cssStyleSheet.ownerRule;

Value

diff --git a/files/en-us/web/api/cssstylesheet/removerule/index.html b/files/en-us/web/api/cssstylesheet/removerule/index.html index 515e779a2fe6adf..7d4b819937ed22f 100644 --- a/files/en-us/web/api/cssstylesheet/removerule/index.html +++ b/files/en-us/web/api/cssstylesheet/removerule/index.html @@ -34,7 +34,7 @@

Syntax

-
cssStyleSheet.removeRule(index)
+
cssStyleSheet.removeRule(index)
 

Parameters

diff --git a/files/en-us/web/api/cssstylesheet/rules/index.html b/files/en-us/web/api/cssstylesheet/rules/index.html index 584dba719efc21f..fdf836990af8639 100644 --- a/files/en-us/web/api/cssstylesheet/rules/index.html +++ b/files/en-us/web/api/cssstylesheet/rules/index.html @@ -36,7 +36,7 @@

Syntax

var rules = cssStyleSheet.rules;
+ class="brush: js">var rules = cssStyleSheet.rules;

Value

diff --git a/files/en-us/web/api/customelementregistry/define/index.html b/files/en-us/web/api/customelementregistry/define/index.html index c41e6f4936ef73e..2470e6b4ab92bc5 100644 --- a/files/en-us/web/api/customelementregistry/define/index.html +++ b/files/en-us/web/api/customelementregistry/define/index.html @@ -26,7 +26,7 @@

Syntax

-
customElements.define(name, constructor, options);
+
customElements.define(name, constructor, options);
 

Parameters

diff --git a/files/en-us/web/api/customelementregistry/get/index.html b/files/en-us/web/api/customelementregistry/get/index.html index 3781f8c9b03b145..493f26650b9e73a 100644 --- a/files/en-us/web/api/customelementregistry/get/index.html +++ b/files/en-us/web/api/customelementregistry/get/index.html @@ -19,7 +19,7 @@

Syntax

-
constructor = customElements.get(name);
+
constructor = customElements.get(name);
 

Parameters

@@ -37,7 +37,7 @@

Return value

Examples

-
customElements.define('my-paragraph',
+
customElements.define('my-paragraph',
   class extends HTMLElement {
     constructor() {
       let templateContent = document.getElementById('my-paragraph').content;
diff --git a/files/en-us/web/api/customelementregistry/upgrade/index.html b/files/en-us/web/api/customelementregistry/upgrade/index.html
index 32e9f9e6c9e83c1..d80df7d28160a26 100644
--- a/files/en-us/web/api/customelementregistry/upgrade/index.html
+++ b/files/en-us/web/api/customelementregistry/upgrade/index.html
@@ -19,7 +19,7 @@
 
 

Syntax

-
customElements.upgrade(root);
+
customElements.upgrade(root);
 

Parameters

diff --git a/files/en-us/web/api/customelementregistry/whendefined/index.html b/files/en-us/web/api/customelementregistry/whendefined/index.html index 3757c0a8d71da1f..92241ff8c19f355 100644 --- a/files/en-us/web/api/customelementregistry/whendefined/index.html +++ b/files/en-us/web/api/customelementregistry/whendefined/index.html @@ -19,7 +19,7 @@

Syntax

customElements.whenDefined(name): Promise<CustomElementConstructor>;
+ class="brush: js">customElements.whenDefined(name): Promise<CustomElementConstructor>;

Parameters

@@ -65,7 +65,7 @@

Examples

make up a menu are defined. The menu displays placeholder content until the actual menu content is ready to display.

-
<nav id="menu-container">
+
<nav id="menu-container">
   <div class="menu-placeholder">Loading...</div>
   <nav-menu>
     <menu-item>Item 1</menu-item>
@@ -76,7 +76,7 @@ 

Examples

</nav>
-
const container = document.getElementById('menu-container');
+
const container = document.getElementById('menu-container');
 const placeholder = container.querySelector('.menu-placeholder');
 // Fetch all the children of menu that are not yet defined.
 const undefinedElements = container.querySelectorAll(':not(:defined)');
diff --git a/files/en-us/web/api/customevent/customevent/index.html b/files/en-us/web/api/customevent/customevent/index.html
index 3a1cef6a5887b5c..204144a40eb89a0 100644
--- a/files/en-us/web/api/customevent/customevent/index.html
+++ b/files/en-us/web/api/customevent/customevent/index.html
@@ -18,7 +18,7 @@
 

Syntax

 event = new CustomEvent(typeArg, customEventInit);
+ class="brush: js"> event = new CustomEvent(typeArg, customEventInit);

Parameters

diff --git a/files/en-us/web/api/customevent/detail/index.html b/files/en-us/web/api/customevent/detail/index.html index 997bd240c872911..e7c52a35784f138 100644 --- a/files/en-us/web/api/customevent/detail/index.html +++ b/files/en-us/web/api/customevent/detail/index.html @@ -20,7 +20,7 @@

Syntax

 let myDetail = customEventInstance.detail;
+ class="brush: js"> let myDetail = customEventInstance.detail;

Return value

@@ -28,7 +28,7 @@

Return value

Example

-
// add an appropriate event listener
+
// add an appropriate event listener
 obj.addEventListener("cat", function(e) { process(e.detail) });
 
 // create and dispatch the event
diff --git a/files/en-us/web/api/customevent/initcustomevent/index.html b/files/en-us/web/api/customevent/initcustomevent/index.html
index 3beb9e41f43058a..61c03e65d7fc17b 100644
--- a/files/en-us/web/api/customevent/initcustomevent/index.html
+++ b/files/en-us/web/api/customevent/initcustomevent/index.html
@@ -31,7 +31,7 @@
 
 

Syntax

-
event.initCustomEvent(type, canBubble, cancelable, detail);
+
event.initCustomEvent(type, canBubble, cancelable, detail);
 

Parameters

diff --git a/files/en-us/web/api/datatransfer/addelement/index.html b/files/en-us/web/api/datatransfer/addelement/index.html index dcab735a96f73c1..f21fdf7cba03fae 100644 --- a/files/en-us/web/api/datatransfer/addelement/index.html +++ b/files/en-us/web/api/datatransfer/addelement/index.html @@ -21,7 +21,7 @@

Syntax

-
void dataTransfer.addElement(el);
+
void dataTransfer.addElement(el);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/cleardata/index.html b/files/en-us/web/api/datatransfer/cleardata/index.html index 70e8818b6c1dd0d..8e20aa668df6c99 100644 --- a/files/en-us/web/api/datatransfer/cleardata/index.html +++ b/files/en-us/web/api/datatransfer/cleardata/index.html @@ -30,7 +30,7 @@

Syntax

-
DataTransfer.clearData([format]);
+
DataTransfer.clearData([format]);
 

Parameters

@@ -51,7 +51,7 @@

Example

HTML

-
<span class="tweaked" id="source" draggable="true">
+
<span class="tweaked" id="source" draggable="true">
   Select this element, drag it to the Drop Zone and then release the selection to move the element.
 </span>
 <span class="tweaked" id="target">Drop Zone</span>
@@ -61,7 +61,7 @@ 

HTML

CSS

-
span.tweaked {
+
span.tweaked {
   display: inline-block;
   margin: 1em 0;
   padding: 1em 2em;
@@ -79,7 +79,7 @@ 

CSS

JavaScript

-
window.addEventListener('DOMContentLoaded', function () {
+
window.addEventListener('DOMContentLoaded', function () {
   // Select HTML elements
   var draggable = document.getElementById('source');
   var dropable = document.getElementById('target');
diff --git a/files/en-us/web/api/datatransfer/datatransfer/index.html b/files/en-us/web/api/datatransfer/datatransfer/index.html
index 9c85afd86583600..8527bfba361db8b 100644
--- a/files/en-us/web/api/datatransfer/datatransfer/index.html
+++ b/files/en-us/web/api/datatransfer/datatransfer/index.html
@@ -17,7 +17,7 @@
 

Syntax

var dataTrans = new DataTransfer()
+ class="brush: js">var dataTrans = new DataTransfer()

Parameters

diff --git a/files/en-us/web/api/datatransfer/dropeffect/index.html b/files/en-us/web/api/datatransfer/dropeffect/index.html index 4eda6386df968fd..7e40896f338826f 100644 --- a/files/en-us/web/api/datatransfer/dropeffect/index.html +++ b/files/en-us/web/api/datatransfer/dropeffect/index.html @@ -37,7 +37,7 @@

Syntax

-
dataTransfer.dropEffect;
+
dataTransfer.dropEffect;
 

Values

diff --git a/files/en-us/web/api/datatransfer/effectallowed/index.html b/files/en-us/web/api/datatransfer/effectallowed/index.html index 4f023ad569d6e5c..eb71fd499204198 100644 --- a/files/en-us/web/api/datatransfer/effectallowed/index.html +++ b/files/en-us/web/api/datatransfer/effectallowed/index.html @@ -29,7 +29,7 @@

Syntax

-
dataTransfer.effectAllowed;
+
dataTransfer.effectAllowed;
 

Values

diff --git a/files/en-us/web/api/datatransfer/files/index.html b/files/en-us/web/api/datatransfer/files/index.html index c0f2d6f384986ce..d0dd84e305c534e 100644 --- a/files/en-us/web/api/datatransfer/files/index.html +++ b/files/en-us/web/api/datatransfer/files/index.html @@ -19,7 +19,7 @@

Syntax

-
dataTransfer.files;
+
dataTransfer.files;
 

Return value

diff --git a/files/en-us/web/api/datatransfer/getdata/index.html b/files/en-us/web/api/datatransfer/getdata/index.html index a1a4d2d48de7db0..521a7f0b5c06d2e 100644 --- a/files/en-us/web/api/datatransfer/getdata/index.html +++ b/files/en-us/web/api/datatransfer/getdata/index.html @@ -19,7 +19,7 @@

Syntax

-
dataTransfer.getData(format);
+
dataTransfer.getData(format);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/items/index.html b/files/en-us/web/api/datatransfer/items/index.html index f0d0f8203d860dd..efb89a2e32e5747 100644 --- a/files/en-us/web/api/datatransfer/items/index.html +++ b/files/en-us/web/api/datatransfer/items/index.html @@ -17,7 +17,7 @@

Syntax

-
itemList = dataTransfer.items;
+
itemList = dataTransfer.items;
 

Return value

diff --git a/files/en-us/web/api/datatransfer/mozcleardataat/index.html b/files/en-us/web/api/datatransfer/mozcleardataat/index.html index c4efb8229ad2e7e..d419472c70777ce 100644 --- a/files/en-us/web/api/datatransfer/mozcleardataat/index.html +++ b/files/en-us/web/api/datatransfer/mozcleardataat/index.html @@ -28,7 +28,7 @@

Syntax

-
void dataTransfer.mozClearDataAt([type], index);
+
void dataTransfer.mozClearDataAt([type], index);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/mozcursor/index.html b/files/en-us/web/api/datatransfer/mozcursor/index.html index 18198e54f5c4102..9f62309440b1349 100644 --- a/files/en-us/web/api/datatransfer/mozcursor/index.html +++ b/files/en-us/web/api/datatransfer/mozcursor/index.html @@ -35,7 +35,7 @@

Syntax

-
dataTransfer.mozCursor;
+
dataTransfer.mozCursor;
 

Return value

diff --git a/files/en-us/web/api/datatransfer/mozgetdataat/index.html b/files/en-us/web/api/datatransfer/mozgetdataat/index.html index f28dab2f86b8ca1..1df9c79f845962c 100644 --- a/files/en-us/web/api/datatransfer/mozgetdataat/index.html +++ b/files/en-us/web/api/datatransfer/mozgetdataat/index.html @@ -22,7 +22,7 @@

Syntax

-
nsIVariant dataTransfer.mozGetDataAt([type], index);
+
nsIVariant dataTransfer.mozGetDataAt([type], index);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/mozitemcount/index.html b/files/en-us/web/api/datatransfer/mozitemcount/index.html index 916881e205cb261..026b3ca2e12df54 100644 --- a/files/en-us/web/api/datatransfer/mozitemcount/index.html +++ b/files/en-us/web/api/datatransfer/mozitemcount/index.html @@ -22,7 +22,7 @@

Syntax

-
dataTransfer.mozItemCount;
+
dataTransfer.mozItemCount;
 

Return value

diff --git a/files/en-us/web/api/datatransfer/mozsetdataat/index.html b/files/en-us/web/api/datatransfer/mozsetdataat/index.html index 4aeb26de03d0462..21c9584fad7a9bc 100644 --- a/files/en-us/web/api/datatransfer/mozsetdataat/index.html +++ b/files/en-us/web/api/datatransfer/mozsetdataat/index.html @@ -35,7 +35,7 @@

Syntax

-
void dataTransfer.mozSetDataAt([type], data, index);
+
void dataTransfer.mozSetDataAt([type], data, index);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/mozsourcenode/index.html b/files/en-us/web/api/datatransfer/mozsourcenode/index.html index 61aa510e536f2b6..c803a03a02baf92 100644 --- a/files/en-us/web/api/datatransfer/mozsourcenode/index.html +++ b/files/en-us/web/api/datatransfer/mozsourcenode/index.html @@ -24,7 +24,7 @@

Syntax

-
dataTransfer.mozSourceNode;
+
dataTransfer.mozSourceNode;
 

Return value

diff --git a/files/en-us/web/api/datatransfer/moztypesat/index.html b/files/en-us/web/api/datatransfer/moztypesat/index.html index 5ead04336a51170..e31acb58f9dd226 100644 --- a/files/en-us/web/api/datatransfer/moztypesat/index.html +++ b/files/en-us/web/api/datatransfer/moztypesat/index.html @@ -21,7 +21,7 @@

Syntax

-
nsIVariant dataTransfer.mozTypesAt(index);
+
nsIVariant dataTransfer.mozTypesAt(index);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/mozusercancelled/index.html b/files/en-us/web/api/datatransfer/mozusercancelled/index.html index 803f19b12e70428..63674ab7babc928 100644 --- a/files/en-us/web/api/datatransfer/mozusercancelled/index.html +++ b/files/en-us/web/api/datatransfer/mozusercancelled/index.html @@ -24,7 +24,7 @@

Syntax

-
dataTransfer.mozUserCancelled;
+
dataTransfer.mozUserCancelled;
 

Return value

diff --git a/files/en-us/web/api/datatransfer/setdata/index.html b/files/en-us/web/api/datatransfer/setdata/index.html index a39d9aa7913d1f7..0d7359c6f7cb4cb 100644 --- a/files/en-us/web/api/datatransfer/setdata/index.html +++ b/files/en-us/web/api/datatransfer/setdata/index.html @@ -23,7 +23,7 @@

Syntax

-
void dataTransfer.setData(format, data);
+
void dataTransfer.setData(format, data);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/setdragimage/index.html b/files/en-us/web/api/datatransfer/setdragimage/index.html index e3e75b5932b0f24..f9ba7bf4485f231 100644 --- a/files/en-us/web/api/datatransfer/setdragimage/index.html +++ b/files/en-us/web/api/datatransfer/setdragimage/index.html @@ -28,7 +28,7 @@

Syntax

-
void dataTransfer.setDragImage(img | element, xOffset, yOffset);
+
void dataTransfer.setDragImage(img | element, xOffset, yOffset);
 

Arguments

diff --git a/files/en-us/web/api/datatransfer/types/index.html b/files/en-us/web/api/datatransfer/types/index.html index e04926e4b4dc83c..90b9370ad8d2617 100644 --- a/files/en-us/web/api/datatransfer/types/index.html +++ b/files/en-us/web/api/datatransfer/types/index.html @@ -21,7 +21,7 @@

Syntax

-
dataTransfer.types;
+
dataTransfer.types;
 

Return value

diff --git a/files/en-us/web/api/device_memory_api/index.html b/files/en-us/web/api/device_memory_api/index.html index 2233457760597ac..a66405e64847a3e 100644 --- a/files/en-us/web/api/device_memory_api/index.html +++ b/files/en-us/web/api/device_memory_api/index.html @@ -16,7 +16,7 @@

JavaScript API

You may query the approximate amount of RAM a device has by retrieving {{DOMxRef("Navigator.deviceMemory")}}

-
var RAM = navigator.deviceMemory;
+
var RAM = navigator.deviceMemory;

Client Hints

diff --git a/files/en-us/web/api/domhighrestimestamp/index.html b/files/en-us/web/api/domhighrestimestamp/index.html index 9013e44a32aeafb..0a071f41c6262ad 100644 --- a/files/en-us/web/api/domhighrestimestamp/index.html +++ b/files/en-us/web/api/domhighrestimestamp/index.html @@ -25,7 +25,7 @@

Reduced time precision

To offer protection against timing attacks and fingerprinting, the precision of time stamps might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision preference is enabled by default and defaults to 20 µs in Firefox 59; in 60 it will be 2ms.

-
// reduced time precision (2ms) in Firefox 60
+
// reduced time precision (2ms) in Firefox 60
 event.timeStamp
 // 1519211809934
 // 1519211810362
@@ -78,7 +78,7 @@ 

Example

To determine how much time has elapsed since a particular point in your code, you can do something like this:

-
let startTime = performance.now();
+
let startTime = performance.now();
 
 /* ... do things for a while ... */
 
diff --git a/files/en-us/web/api/dompointinit/w/index.html b/files/en-us/web/api/dompointinit/w/index.html
index 6892f365d5a8e3a..84b5d04ea3c7ded 100644
--- a/files/en-us/web/api/dompointinit/w/index.html
+++ b/files/en-us/web/api/dompointinit/w/index.html
@@ -22,7 +22,7 @@
 
 

Syntax

-
var DOMPointInit = {
+
var DOMPointInit = {
   w: wPerspective
 };
 
diff --git a/files/en-us/web/api/dompointinit/x/index.html b/files/en-us/web/api/dompointinit/x/index.html
index 88714a8186eb105..f485b7010970697 100644
--- a/files/en-us/web/api/dompointinit/x/index.html
+++ b/files/en-us/web/api/dompointinit/x/index.html
@@ -26,7 +26,7 @@
 
 

Syntax

-
var DOMPointInit = {
+
var DOMPointInit = {
   x: xPos
 };
 
diff --git a/files/en-us/web/api/dompointinit/y/index.html b/files/en-us/web/api/dompointinit/y/index.html
index 0277e1a34f7be12..28f498d405d8c18 100644
--- a/files/en-us/web/api/dompointinit/y/index.html
+++ b/files/en-us/web/api/dompointinit/y/index.html
@@ -26,7 +26,7 @@
 
 

Syntax

-
var DOMPointInit = {
+
var DOMPointInit = {
   y: yPos
 };
 
diff --git a/files/en-us/web/api/dompointinit/z/index.html b/files/en-us/web/api/dompointinit/z/index.html
index 11099651b770a94..bb5e9ff29e44c6b 100644
--- a/files/en-us/web/api/dompointinit/z/index.html
+++ b/files/en-us/web/api/dompointinit/z/index.html
@@ -30,7 +30,7 @@
 
 

Syntax

-
var DOMPointInit = {
+
var DOMPointInit = {
   z: zPos
 };
 
diff --git a/files/en-us/web/api/effecttiming/delay/index.html b/files/en-us/web/api/effecttiming/delay/index.html
index 1b0b5ffec031376..ff735a4c95d300b 100644
--- a/files/en-us/web/api/effecttiming/delay/index.html
+++ b/files/en-us/web/api/effecttiming/delay/index.html
@@ -35,7 +35,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   delay: delayInMilliseconds
 };
 
diff --git a/files/en-us/web/api/effecttiming/direction/index.html b/files/en-us/web/api/effecttiming/direction/index.html
index 947b7fa967c17ef..e3b52de75bc3463 100644
--- a/files/en-us/web/api/effecttiming/direction/index.html
+++ b/files/en-us/web/api/effecttiming/direction/index.html
@@ -36,7 +36,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   direction: "normal" | "reverse" | "alternate" | "alternate-reverse"
 };
 
@@ -72,7 +72,7 @@ 

Examples

Key example, Alice waves her arm up and down by passing her an alternate value for her direction property:

-
// Get Alice's arm, and wave it up and down
+
// Get Alice's arm, and wave it up and down
 document.getElementById("alice_arm").animate([
   { transform: 'rotate(10deg)' },
   { transform: 'rotate(-40deg)' }
diff --git a/files/en-us/web/api/effecttiming/duration/index.html b/files/en-us/web/api/effecttiming/duration/index.html
index 8b8927d42078190..323c7670bb45195 100644
--- a/files/en-us/web/api/effecttiming/duration/index.html
+++ b/files/en-us/web/api/effecttiming/duration/index.html
@@ -36,7 +36,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   duration: durationInMilliseconds | "auto"
 };
 
diff --git a/files/en-us/web/api/effecttiming/easing/index.html b/files/en-us/web/api/effecttiming/easing/index.html
index af269650f8fb2e2..24d122cbbb6ccf5 100644
--- a/files/en-us/web/api/effecttiming/easing/index.html
+++ b/files/en-us/web/api/effecttiming/easing/index.html
@@ -38,7 +38,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   easing: {{cssxref("single-transition-timing-function")}}
 }
 
diff --git a/files/en-us/web/api/effecttiming/enddelay/index.html b/files/en-us/web/api/effecttiming/enddelay/index.html
index 86c311906f8985f..aced63935e4ca99 100644
--- a/files/en-us/web/api/effecttiming/enddelay/index.html
+++ b/files/en-us/web/api/effecttiming/enddelay/index.html
@@ -46,7 +46,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   endDelay: delayInMilliseconds
 }
 
diff --git a/files/en-us/web/api/effecttiming/fill/index.html b/files/en-us/web/api/effecttiming/fill/index.html
index dced2776ce4dcfc..66183fbc9e26bc5 100644
--- a/files/en-us/web/api/effecttiming/fill/index.html
+++ b/files/en-us/web/api/effecttiming/fill/index.html
@@ -45,7 +45,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   fill: "none" | "forwards" | "backwards" | "both" | "auto"
 }
 
diff --git a/files/en-us/web/api/effecttiming/iterations/index.html b/files/en-us/web/api/effecttiming/iterations/index.html index 0320e3059d0b4f7..8b35cef46203a7d 100644 --- a/files/en-us/web/api/effecttiming/iterations/index.html +++ b/files/en-us/web/api/effecttiming/iterations/index.html @@ -38,7 +38,7 @@

Syntax

-
var timingProperties = {
+
var timingProperties = {
   iterations: numberOfIterations
 };
 
diff --git a/files/en-us/web/api/effecttiming/iterationstart/index.html b/files/en-us/web/api/effecttiming/iterationstart/index.html
index 37b5b7ed1b77f2c..f1a3ec87ee9a416 100644
--- a/files/en-us/web/api/effecttiming/iterationstart/index.html
+++ b/files/en-us/web/api/effecttiming/iterationstart/index.html
@@ -36,7 +36,7 @@
 
 

Syntax

-
var timingProperties = {
+
var timingProperties = {
   iterationStart = iterationNumber
 };
 
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html
index 21fcdaab481faa1..872e719c618f84b 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html
@@ -15,7 +15,7 @@
 
 

Syntax

-
void ext.beginQueryEXT(target, query);
+
void ext.beginQueryEXT(target, query);
 

Parameters

@@ -35,7 +35,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var query = ext.createQueryEXT();
 ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
 
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html
index bec75186dd9ecb0..96c2cd8ed379b9c 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html
@@ -17,7 +17,7 @@
 
 

Syntax

-
WebGLTimerQueryEXT ext.createQueryEXT();
+
WebGLTimerQueryEXT ext.createQueryEXT();
 

Parameters

@@ -30,7 +30,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var query = ext.createQueryExt();
 
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html index 5381ffa2dcddc9e..5082cd67e9b1eda 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html @@ -16,7 +16,7 @@

Syntax

-
void ext.deleteQueryEXT(query);
+
void ext.deleteQueryEXT(query);
 

Parameters

@@ -32,7 +32,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var query = ext.createQueryEXT();
 
 // ...
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html
index 9dc4d5ea7d079a4..0ad5d08ec22fa4e 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html
@@ -15,7 +15,7 @@
 
 

Syntax

-
void ext.endQueryEXT(target);
+
void ext.endQueryEXT(target);
 

Parameters

@@ -32,7 +32,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var query = ext.createQueryEXT();
 ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
 
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html
index a0ee23c1556b944..65ffdcc90327766 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html
@@ -16,7 +16,7 @@
 
 

Syntax

-
any ext.getQueryEXT(target, pname);
+
any ext.getQueryEXT(target, pname);
 

Parameters

@@ -45,7 +45,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var startQuery = ext.createQueryEXT();
 ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);
 
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html
index 288423b1f31a10d..dd7b8de3d13a49b 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html
@@ -16,7 +16,7 @@
 
 

Syntax

-
any ext.getQueryObjectEXT(query, pname);
+
any ext.getQueryObjectEXT(query, pname);
 

Parameters

@@ -42,7 +42,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var query = ext.createQueryEXT();
 ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
 
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/index.html b/files/en-us/web/api/ext_disjoint_timer_query/index.html
index e30aec2e24a8995..1929a56d72af172 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/index.html
@@ -83,7 +83,7 @@ 

Methods

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 

Specifications

diff --git a/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html index 44f09e73d70b6b9..10221e5a1f60777 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html @@ -16,7 +16,7 @@

Syntax

-
GLBoolean ext.isQueryEXT(query);
+
GLBoolean ext.isQueryEXT(query);
 

Parameters

@@ -34,7 +34,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var query = ext.createQueryEXT();
 
 // ...
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html
index 20b1dc1ca184f3b..e5049e502d38a99 100644
--- a/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html
+++ b/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html
@@ -16,7 +16,7 @@
 
 

Syntax

-
void ext.queryCounterEXT(query, target);
+
void ext.queryCounterEXT(query, target);
 

Parameters

@@ -36,7 +36,7 @@

Return value

Examples

-
var ext = gl.getExtension('EXT_disjoint_timer_query');
+
var ext = gl.getExtension('EXT_disjoint_timer_query');
 var startQuery = ext.createQueryEXT();
 var endQuery = ext.createQueryEXT();
 ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);
diff --git a/files/en-us/web/api/featurepolicy/allowedfeatures/index.html b/files/en-us/web/api/featurepolicy/allowedfeatures/index.html
index 5b2d3b3bcdaf6d7..a860c44a9e17861 100644
--- a/files/en-us/web/api/featurepolicy/allowedfeatures/index.html
+++ b/files/en-us/web/api/featurepolicy/allowedfeatures/index.html
@@ -20,7 +20,7 @@
 
 

Syntax

-
const allowed = FeaturePolicy.allowedFeatures()
+
const allowed = FeaturePolicy.allowedFeatures()
 

Parameters

diff --git a/files/en-us/web/api/featurepolicy/allowsfeature/index.html b/files/en-us/web/api/featurepolicy/allowsfeature/index.html index c70fde788667adf..9537881d4ac9c38 100644 --- a/files/en-us/web/api/featurepolicy/allowsfeature/index.html +++ b/files/en-us/web/api/featurepolicy/allowsfeature/index.html @@ -12,13 +12,13 @@

Syntax

-
const allowed = FeaturePolicy.allowsFeature(<feature>)
+
const allowed = FeaturePolicy.allowsFeature(<feature>)
 

or

const allowed = FeaturePolicy.allowsFeature(<feature>, <origin>)
+ class="brush: js">const allowed = FeaturePolicy.allowsFeature(<feature>, <origin>)

Parameters

diff --git a/files/en-us/web/api/featurepolicy/features/index.html b/files/en-us/web/api/featurepolicy/features/index.html index 7bcc5eb085658ad..90512f455b09589 100644 --- a/files/en-us/web/api/featurepolicy/features/index.html +++ b/files/en-us/web/api/featurepolicy/features/index.html @@ -12,7 +12,7 @@

Syntax

-
const supportedFeatures = FeaturePolicy.features()
+
const supportedFeatures = FeaturePolicy.features()
 

Parameters

diff --git a/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html b/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html index 112e5581b851fd6..2f1191eb5d4606f 100644 --- a/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html +++ b/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html @@ -15,7 +15,7 @@

Syntax

-
const allowlist = FeaturePolicy.getAllowlistForFeature(<feature>)
+
const allowlist = FeaturePolicy.getAllowlistForFeature(<feature>)
 

Parameter

@@ -41,7 +41,7 @@

Example

Feature Policy. Please note that Camera API might be restricted by the Permissions API, if the user did not grant the corresponding permission yet.

-
// First, get the Feature Policy object
+
// First, get the Feature Policy object
 const featurePolicy = document.featurePolicy
 
 // Then query feature for specific
diff --git a/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html b/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html
index 7e26ac874948b87..59a7b5756179c99 100644
--- a/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html
+++ b/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html
@@ -26,7 +26,7 @@ 

The problem

In the past we would resolve the relative URL against the current global, for example:

-
let absolute = new URL(relative, window.location.href)
+
let absolute = new URL(relative, window.location.href)

This is not a problem as such. It is just that different APIs that exhibit this kind of behavior were doing it inconsistently with the behavior defined in the spec, which could lead to problems further down the line.

@@ -34,6 +34,6 @@

The solution

In Firefox 60 onwards, Mozilla resolves the relative URL against the global that owns the fetch() function being used (see {{bug(1432272)}}). So in the case described above, it is resolved against the iframe's location:

-
let absolute = new URL(relative, frame.contentWindow.location.href)
+
let absolute = new URL(relative, frame.contentWindow.location.href)

There is a lot of discussion in progress about getting new specs to align with this behavior change, to mitigate potential problems going forward.

diff --git a/files/en-us/web/api/fetch_api/using_fetch/index.html b/files/en-us/web/api/fetch_api/using_fetch/index.html index e175796ef10edd4..342dd363a261dcf 100644 --- a/files/en-us/web/api/fetch_api/using_fetch/index.html +++ b/files/en-us/web/api/fetch_api/using_fetch/index.html @@ -31,7 +31,7 @@

A basic fetch request is really simple to set up. Have a look at the following code:

-
fetch('http://example.com/movies.json')
+
fetch('http://example.com/movies.json')
   .then(response => response.json())
   .then(data => console.log(data));
 
@@ -52,7 +52,7 @@

Supplying request options

See {{domxref("GlobalFetch.fetch","fetch()")}} for the full options available, and more details.

-
// Example POST method implementation:
+
// Example POST method implementation:
 async function postData(url = '', data = {}) {
   // Default options are marked with *
   const response = await fetch(url, {
@@ -94,14 +94,14 @@ 

Sending a request with cred

Note: Access-Control-Allow-Origin is prohibited from using a wildcard for requests with credentials: 'include'. In such cases, the exact origin must be provided; even if you are using a CORS unblocker extension, the requests will still fail.

-
fetch('https://example.com', {
+
fetch('https://example.com', {
   credentials: 'include'
 });
 

If you only want to send credentials if the request URL is on the same origin as the calling script, add credentials: 'same-origin'.

-
// The calling script is on the origin 'https://example.com'
+
// The calling script is on the origin 'https://example.com'
 
 fetch('https://example.com', {
   credentials: 'same-origin'
@@ -110,7 +110,7 @@ 

Sending a request with cred

To instead ensure browsers don’t include credentials in the request, use credentials: 'omit'.

-
fetch('https://example.com', {
+
fetch('https://example.com', {
   credentials: 'omit'
 })
 
@@ -119,7 +119,7 @@

Uploading JSON data

Use {{domxref("GlobalFetch.fetch","fetch()")}} to POST JSON-encoded data.

-
const data = { username: 'example' };
+
const data = { username: 'example' };
 
 fetch('https://example.com/profile', {
   method: 'POST', // or 'PUT'
@@ -141,7 +141,7 @@ 

Uploading a file

Files can be uploaded using an HTML <input type="file" /> input element, {{domxref("FormData.FormData","FormData()")}} and {{domxref("WindowOrWorkerGlobalScope/fetch","fetch()")}}.

-
const formData = new FormData();
+
const formData = new FormData();
 const fileField = document.querySelector('input[type="file"]');
 
 formData.append('username', 'abc123');
@@ -164,7 +164,7 @@ 

Uploading multiple files

Files can be uploaded using an HTML <input type="file" multiple /> input element, {{domxref("FormData.FormData","FormData()")}} and {{domxref("GlobalFetch.fetch","fetch()")}}.

-
const formData = new FormData();
+
const formData = new FormData();
 const photos = document.querySelector('input[type="file"][multiple]');
 
 formData.append('title', 'My Vegas Vacation');
@@ -189,7 +189,7 @@ 

Processing a text file line by line

The chunks that are read from a response are not broken neatly at line boundaries and are Uint8Arrays, not strings. If you want to fetch a text file and process it line by line, it is up to you to handle these complications. The following example shows one way to do this by creating a line iterator (for simplicity, it assumes the text is UTF-8, and doesn't handle fetch errors).

-
async function* makeTextFileLineIterator(fileURL) {
+
async function* makeTextFileLineIterator(fileURL) {
   const utf8Decoder = new TextDecoder('utf-8');
   const response = await fetch(fileURL);
   const reader = response.body.getReader();
@@ -234,7 +234,7 @@ 

Checking that the fetch was succ

A {{domxref("GlobalFetch.fetch","fetch()")}} promise will reject with a {{jsxref("TypeError")}} when a network error is encountered or CORS is misconfigured on the server-side, although this usually means permission issues or similar — a 404 does not constitute a network error, for example. An accurate check for a successful fetch() would include checking that the promise resolved, then checking that the {{domxref("Response.ok")}} property has a value of true. The code would look something like this:

-
fetch('flowers.jpg')
+
fetch('flowers.jpg')
   .then(response => {
     if (!response.ok) {
       throw new Error('Network response was not ok');
@@ -253,7 +253,7 @@ 

Supplying your own request object

Instead of passing a path to the resource you want to request into the fetch() call, you can create a request object using the {{domxref("Request.Request","Request()")}} constructor, and pass that in as a fetch() method argument:

-
const myHeaders = new Headers();
+
const myHeaders = new Headers();
 
 const myRequest = new Request('flowers.jpg', {
   method: 'GET',
@@ -271,7 +271,7 @@ 

Supplying your own request object

Request() accepts exactly the same parameters as the fetch() method. You can even pass in an existing request object to create a copy of it:

-
const anotherRequest = new Request(myRequest, myInit);
+
const anotherRequest = new Request(myRequest, myInit);
 

This is pretty useful, as request and response bodies are one use only. Making a copy like this allows you to make use of the request/response again while varying the init options if desired. The copy must be made before the body is read, and reading the body in the copy will also mark it as read in the original request.

@@ -284,7 +284,7 @@

Headers

The {{domxref("Headers")}} interface allows you to create your own headers object via the {{domxref("Headers.Headers","Headers()")}} constructor. A headers object is a simple multi-map of names to values:

-
const content = 'Hello World';
+
const content = 'Hello World';
 const myHeaders = new Headers();
 myHeaders.append('Content-Type', 'text/plain');
 myHeaders.append('Content-Length', content.length.toString());
@@ -293,7 +293,7 @@ 

Headers

The same can be achieved by passing an array of arrays or an object literal to the constructor:

-
const myHeaders = new Headers({
+
const myHeaders = new Headers({
   'Content-Type': 'text/plain',
   'Content-Length': content.length.toString(),
   'X-Custom-Header': 'ProcessThisImmediately'
@@ -302,7 +302,7 @@ 

Headers

The contents can be queried and retrieved:

-
console.log(myHeaders.has('Content-Type')); // true
+
console.log(myHeaders.has('Content-Type')); // true
 console.log(myHeaders.has('Set-Cookie')); // false
 myHeaders.set('Content-Type', 'text/html');
 myHeaders.append('X-Custom-Header', 'AnotherValue');
@@ -318,7 +318,7 @@ 

Headers

All of the Headers methods throw a TypeError if a header name is used that is not a valid HTTP Header name. The mutation operations will throw a TypeError if there is an immutable guard (see below). Otherwise, they fail silently. For example:

-
const myResponse = Response.error();
+
const myResponse = Response.error();
 try {
   myResponse.headers.set('Origin', 'http://mybank.com');
 } catch (e) {
@@ -328,7 +328,7 @@ 

Headers

A good use case for headers is checking whether the content type is correct before you process it further. For example:

-
fetch(myRequest)
+
fetch(myRequest)
   .then(response => {
      const contentType = response.headers.get('content-type');
      if (!contentType || !contentType.includes('application/json')) {
@@ -374,7 +374,7 @@ 

Response objects

They can also be created programmatically via JavaScript, but this is only really useful in {{domxref("ServiceWorker_API", "ServiceWorkers")}}, when you are providing a custom response to a received request using a {{domxref("FetchEvent.respondWith","respondWith()")}} method:

-
const myBody = new Blob();
+
const myBody = new Blob();
 
 addEventListener('fetch', function(event) {
   // ServiceWorker intercepting a fetch
@@ -419,7 +419,7 @@ 

Body

Request bodies can be set by passing body parameters:

-
const form = new FormData(document.getElementById('login-form'));
+
const form = new FormData(document.getElementById('login-form'));
 fetch('/login', {
   method: 'POST',
   body: form
@@ -432,7 +432,7 @@ 

Feature detection

Fetch API support can be detected by checking for the existence of {{domxref("Headers")}}, {{domxref("Request")}}, {{domxref("Response")}} or {{domxref("GlobalFetch.fetch","fetch()")}} on the {{domxref("Window")}} or {{domxref("Worker")}} scope. For example:

-
if (window.fetch) {
+
if (window.fetch) {
   // run my fetch request here
 } else {
   // do something with XMLHttpRequest?
diff --git a/files/en-us/web/api/fetchevent/client/index.html b/files/en-us/web/api/fetchevent/client/index.html
index 121b6aa54859b69..7c27a86d9783ca4 100644
--- a/files/en-us/web/api/fetchevent/client/index.html
+++ b/files/en-us/web/api/fetchevent/client/index.html
@@ -27,7 +27,7 @@
 
 

Syntax

-
var myClient = FetchEvent.client;
+
var myClient = FetchEvent.client;

Value

diff --git a/files/en-us/web/api/fetchevent/clientid/index.html b/files/en-us/web/api/fetchevent/clientid/index.html index 0132fdf1cd8f25e..b239362068dfadb 100644 --- a/files/en-us/web/api/fetchevent/clientid/index.html +++ b/files/en-us/web/api/fetchevent/clientid/index.html @@ -22,7 +22,7 @@

Syntax

var myClientId = fetchEvent.clientId;
+ class="brush: js">var myClientId = fetchEvent.clientId;

Value

diff --git a/files/en-us/web/api/fetchevent/fetchevent/index.html b/files/en-us/web/api/fetchevent/fetchevent/index.html index 05d2f55cc758eb2..28ca047cf36d6e7 100644 --- a/files/en-us/web/api/fetchevent/fetchevent/index.html +++ b/files/en-us/web/api/fetchevent/fetchevent/index.html @@ -20,7 +20,7 @@

Syntax

var fetchEvent = new FetchEvent(type, init);
+ class="brush: js">var fetchEvent = new FetchEvent(type, init);

Parameters

diff --git a/files/en-us/web/api/fetchevent/index.html b/files/en-us/web/api/fetchevent/index.html index 38e745379384ee8..f7429c6acbfe69d 100644 --- a/files/en-us/web/api/fetchevent/index.html +++ b/files/en-us/web/api/fetchevent/index.html @@ -55,7 +55,7 @@

Examples

This fetch event uses the browser default for non-GET requests. For GET requests it tries to return a match in the cache, and falls back to the network. If it finds a match in the cache, it asynchronously updates the cache for next time.

-
self.addEventListener('fetch', event => {
+
self.addEventListener('fetch', event => {
   // Let the browser do its default thing
   // for non-GET requests.
   if (event.request.method != 'GET') return;
diff --git a/files/en-us/web/api/fetchevent/isreload/index.html b/files/en-us/web/api/fetchevent/isreload/index.html
index ec6a87812336453..e7d0b0b9a1b63d0 100644
--- a/files/en-us/web/api/fetchevent/isreload/index.html
+++ b/files/en-us/web/api/fetchevent/isreload/index.html
@@ -23,7 +23,7 @@
 

Syntax

var reloaded = FetchEvent.isReload
+ class="brush: js">var reloaded = FetchEvent.isReload

Value

diff --git a/files/en-us/web/api/fetchevent/navigationpreload/index.html b/files/en-us/web/api/fetchevent/navigationpreload/index.html index 603f5498759cd0c..66da87c4434f4d2 100644 --- a/files/en-us/web/api/fetchevent/navigationpreload/index.html +++ b/files/en-us/web/api/fetchevent/navigationpreload/index.html @@ -20,7 +20,7 @@

Syntax

var promise = fetchEvent.navigationPreload
+ class="brush: js">var promise = fetchEvent.navigationPreload

Value

diff --git a/files/en-us/web/api/fetchevent/preloadresponse/index.html b/files/en-us/web/api/fetchevent/preloadresponse/index.html index c226b54fdf0c7dd..73df7472c001d0e 100644 --- a/files/en-us/web/api/fetchevent/preloadresponse/index.html +++ b/files/en-us/web/api/fetchevent/preloadresponse/index.html @@ -23,7 +23,7 @@

Syntax

var expectedResponse = fetchEvent.preloadResponse;
+ class="brush: js">var expectedResponse = fetchEvent.preloadResponse;

Value

@@ -41,7 +41,7 @@

Example

object. If no match is found, the code checks for a preloaded response. Else it fetches a response from the network.

-
addEventListener('fetch', event => {
+
addEventListener('fetch', event => {
   event.respondWith(async function() {
     // Respond from the cache if we can
     const cachedResponse = await caches.match(event.request);
diff --git a/files/en-us/web/api/fetchevent/replacesclientid/index.html b/files/en-us/web/api/fetchevent/replacesclientid/index.html
index 4482c2fcb00f912..2d45a02691fe31b 100644
--- a/files/en-us/web/api/fetchevent/replacesclientid/index.html
+++ b/files/en-us/web/api/fetchevent/replacesclientid/index.html
@@ -29,7 +29,7 @@
 

Syntax

var myReplacedClientId = fetchEvent.replacesClientId;
+ class="brush: js">var myReplacedClientId = fetchEvent.replacesClientId;

Value

diff --git a/files/en-us/web/api/fetchevent/request/index.html b/files/en-us/web/api/fetchevent/request/index.html index 86cf9e1a3953ba2..5c6d420d3a0f82e 100644 --- a/files/en-us/web/api/fetchevent/request/index.html +++ b/files/en-us/web/api/fetchevent/request/index.html @@ -25,7 +25,7 @@

Syntax

var recentRequest = fetchEvent.request;
+ class="brush: js">var recentRequest = fetchEvent.request;

Value

diff --git a/files/en-us/web/api/fetchevent/respondwith/index.html b/files/en-us/web/api/fetchevent/respondwith/index.html index a921836b9b32496..15b884a61f4407a 100644 --- a/files/en-us/web/api/fetchevent/respondwith/index.html +++ b/files/en-us/web/api/fetchevent/respondwith/index.html @@ -77,7 +77,7 @@

Specifying the final URL of a re

Syntax

-
fetchEvent.respondWith(
+
fetchEvent.respondWith(
   // Promise that resolves to a Response.
 );
@@ -120,7 +120,7 @@

Examples

This fetch event tries to return a response from the cache API, falling back to the network otherwise.

-
addEventListener('fetch', event => {
+
addEventListener('fetch', event => {
   // Prevent the default, and handle the request ourselves.
   event.respondWith(async function() {
     // Try to get the response from a cache.
diff --git a/files/en-us/web/api/fetchevent/resultingclientid/index.html b/files/en-us/web/api/fetchevent/resultingclientid/index.html
index c30865b35d64791..dbabe91c0b8cf48 100644
--- a/files/en-us/web/api/fetchevent/resultingclientid/index.html
+++ b/files/en-us/web/api/fetchevent/resultingclientid/index.html
@@ -28,7 +28,7 @@
 

Syntax

var myResultingClientId = fetchEvent.resultingClientId;
+ class="brush: js">var myResultingClientId = fetchEvent.resultingClientId;

Value

diff --git a/files/en-us/web/api/file_system_access_api/index.html b/files/en-us/web/api/file_system_access_api/index.html index 2ea479ae6d3adb2..3ce56f52390e0d5 100644 --- a/files/en-us/web/api/file_system_access_api/index.html +++ b/files/en-us/web/api/file_system_access_api/index.html @@ -51,7 +51,7 @@

Accessing files.

The below code allows the user to choose a file from the file picker and then tests to see whether the handle returned is a file or directory

-
// store a reference to our file handle
+
// store a reference to our file handle
 let fileHandle;
 
 async function getFile() {
@@ -69,7 +69,7 @@ 

Accessing files.

The following asynchronous function presents a file picker and once a file is chosen, uses the getFile() method to retrieve the contents.

-
const pickerOpts = {
+
const pickerOpts = {
   types: [
     {
       description: 'Images',
@@ -94,14 +94,14 @@ 

Accessing directories.

The following example returns a directory handle with the specified name, if the directory does not exist it is created.

-
const dirName = 'directoryToGetName';
+
const dirName = 'directoryToGetName';
 
 // assuming we have a directory handle: 'currentDirHandle'
 const subDir = currentDirHandle.getDirectoryHandle(dirName, {create: true});

The following asynchronous function uses resolve() to find the path to a chosen file, relative to a specified directory handle.

-
async function returnPathDirectories(directoryHandle) {
+
async function returnPathDirectories(directoryHandle) {
 
   // Get a file handle by showing a file picker:
   const handle = await self.showOpenFilePicker();
@@ -132,7 +132,7 @@ 

Writing to files.

A user defined {{domxref('Blob')}} is then written to the stream which is subsequently closed.

-
async function saveFile() {
+
async function saveFile() {
 
   // create a new handle
   const newHandle = await window.showSaveFilePicker();
@@ -150,7 +150,7 @@ 

Writing to files.

The following show different examples of options that can be passed into the write() method.

-
// just pass in the data (no options)
+
// just pass in the data (no options)
 writableStream.write(data)
 
 // writes the data to the stream from the determined position
diff --git a/files/en-us/web/api/filerequest/lockedfile/index.html b/files/en-us/web/api/filerequest/lockedfile/index.html
index 2e9b78659ff5723..33c5e508aaa64d2 100644
--- a/files/en-us/web/api/filerequest/lockedfile/index.html
+++ b/files/en-us/web/api/filerequest/lockedfile/index.html
@@ -19,7 +19,7 @@ 

Summary

Syntax

-
var lockedFile = instanceOfFileRequest.lockedFile
+
var lockedFile = instanceOfFileRequest.lockedFile
 

Value

diff --git a/files/en-us/web/api/filesystemfileentry/createwriter/index.html b/files/en-us/web/api/filesystemfileentry/createwriter/index.html index c22acf69203a670..34961da218e1985 100644 --- a/files/en-us/web/api/filesystemfileentry/createwriter/index.html +++ b/files/en-us/web/api/filesystemfileentry/createwriter/index.html @@ -23,7 +23,7 @@

Syntax

FileSystemFileEntry.createWriter(successCallback[, errorCallback]);
+ class="brush: js">FileSystemFileEntry.createWriter(successCallback[, errorCallback]);

Parameters

diff --git a/files/en-us/web/api/filesystemfileentry/file/index.html b/files/en-us/web/api/filesystemfileentry/file/index.html index aba8afbb0764b23..ee4a2f758974cf8 100644 --- a/files/en-us/web/api/filesystemfileentry/file/index.html +++ b/files/en-us/web/api/filesystemfileentry/file/index.html @@ -22,7 +22,7 @@

Syntax

FileSystemFileEntry.file(successCallback[, errorCallback]);
+ class="brush: js">FileSystemFileEntry.file(successCallback[, errorCallback]);

Parameters

diff --git a/files/en-us/web/api/filesystemwritablefilestream/index.html b/files/en-us/web/api/filesystemwritablefilestream/index.html index 310052e4f21e332..69b92e7e4a0da46 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/index.html @@ -36,7 +36,7 @@

Examples

A user defined {{domxref('Blob')}} is then written to the stream which is subsequently closed.

-
async function saveFile() {
+
async function saveFile() {
 
   // create a new handle
   const newHandle = await window.showSaveFilePicker();
@@ -54,7 +54,7 @@ 

Examples

The following show different examples of options that can be passed into the write() method.

-
// just pass in the data (no options)
+
// just pass in the data (no options)
 writableStream.write(data)
 
 // writes the data to the stream from the determined position
diff --git a/files/en-us/web/api/filesystemwritablefilestream/seek/index.html b/files/en-us/web/api/filesystemwritablefilestream/seek/index.html
index b216a2aa4a7d4b8..89915e5a49ece30 100644
--- a/files/en-us/web/api/filesystemwritablefilestream/seek/index.html
+++ b/files/en-us/web/api/filesystemwritablefilestream/seek/index.html
@@ -19,7 +19,7 @@
 

Syntax

FileSystemWritableStream.seek(position).then(...);
+ class="brush: js">FileSystemWritableStream.seek(position).then(...);

Parameters

diff --git a/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html b/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html index a8487f7e1014bf9..afa057b6436b275 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html @@ -29,7 +29,7 @@

Syntax

FileSystemWritableFileStream.truncate().then(...);
+ class="brush: js">FileSystemWritableFileStream.truncate().then(...);

Parameters

@@ -53,7 +53,7 @@

Exceptions

Examples

-
// todo
+
// todo
 

Specifications

diff --git a/files/en-us/web/api/filesystemwritablefilestream/write/index.html b/files/en-us/web/api/filesystemwritablefilestream/write/index.html index c426449dc49291a..b0adc04055bb2de 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/write/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/write/index.html @@ -25,7 +25,7 @@

Syntax

FileSystemWritableFileStream.write(data).then(...);
+ class="brush: js">FileSystemWritableFileStream.write(data).then(...);

Parameters

@@ -77,7 +77,7 @@

Examples

A user defined {{domxref('Blob')}} is then written to the stream which is subsequently closed.

-
async function saveFile() {
+
async function saveFile() {
 
   // create a new handle
   const newHandle = await window.showSaveFilePicker();
@@ -96,7 +96,7 @@ 

Examples

The following show different examples of options that can be passed into the write() method.

-
// just pass in the data (no options)
+
// just pass in the data (no options)
 writableStream.write(data)
 
 // writes the data to the stream from the determined position
diff --git a/files/en-us/web/api/fontfaceset/check/index.html b/files/en-us/web/api/fontfaceset/check/index.html
index adc7ac476d72612..1fb006c3ddd1cd3 100644
--- a/files/en-us/web/api/fontfaceset/check/index.html
+++ b/files/en-us/web/api/fontfaceset/check/index.html
@@ -17,7 +17,7 @@
 
 

Syntax

-
bool = aFontFaceSet.check(font);
+
bool = aFontFaceSet.check(font);
 bool = aFontFaceSet.check(font, text);
 
@@ -38,7 +38,7 @@

Parameters

Examples

-
document.fonts.check("12px courier"); // returns true if the font courier is available at 12px
+
document.fonts.check("12px courier"); // returns true if the font courier is available at 12px
 
 document.fonts.check("12px MyFont", "ß"); // returns true if the font 'MyFont' has a ß character.
 
diff --git a/files/en-us/web/api/fontfaceset/load/index.html b/files/en-us/web/api/fontfaceset/load/index.html index d13cb0054f904fa..70eee9b82296f90 100644 --- a/files/en-us/web/api/fontfaceset/load/index.html +++ b/files/en-us/web/api/fontfaceset/load/index.html @@ -17,7 +17,7 @@

Syntax

-
result = aFontFaceSet.load(font);
+
result = aFontFaceSet.load(font);
 
 result = aFontFaceSet.load(font, text);
 
@@ -41,7 +41,7 @@

Parameters

Examples

-
// returns a promise that will be fulfilled or rejected according the success to load MyFont
+
// returns a promise that will be fulfilled or rejected according the success to load MyFont
 // The code in 'then' can assume the availability of that font.
 
 document.fonts.load("12px MyFont", "ß").then(…);
diff --git a/files/en-us/web/api/fontfaceset/ready/index.html b/files/en-us/web/api/fontfaceset/ready/index.html
index 15ec0e976a4ae7b..3f2811789f6a5f2 100644
--- a/files/en-us/web/api/fontfaceset/ready/index.html
+++ b/files/en-us/web/api/fontfaceset/ready/index.html
@@ -20,7 +20,7 @@
 
 

Syntax

-
fontFaceSet.ready.then(function(fontFaceSet) {
+
fontFaceSet.ready.then(function(fontFaceSet) {
   // ...
 });
diff --git a/files/en-us/web/api/formdataevent/formdata/index.html b/files/en-us/web/api/formdataevent/formdata/index.html index 34ad77a237e79ce..449d73d92401a11 100644 --- a/files/en-us/web/api/formdataevent/formdata/index.html +++ b/files/en-us/web/api/formdataevent/formdata/index.html @@ -18,7 +18,7 @@

Syntax

formData = formDataEvent.formData
+ class="brush: js">formData = formDataEvent.formData

Returns

diff --git a/files/en-us/web/api/formdataevent/formdataevent/index.html b/files/en-us/web/api/formdataevent/formdataevent/index.html index 3329edc770029fa..e865b2c12720964 100644 --- a/files/en-us/web/api/formdataevent/formdataevent/index.html +++ b/files/en-us/web/api/formdataevent/formdataevent/index.html @@ -17,7 +17,7 @@

Syntax

new FormDataEvent(type[, formEventInit]);
+ class="brush: js">new FormDataEvent(type[, formEventInit]);

Values

diff --git a/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html b/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html index 3263048168f657e..bd723afbe4b5474 100644 --- a/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html +++ b/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html @@ -24,7 +24,7 @@

Connecting to a gamepad

You can use {{domxref("Window/gamepadconnected_event", "gamepadconnected")}} like this:

-
window.addEventListener("gamepadconnected", function(e) {
+
window.addEventListener("gamepadconnected", function(e) {
   console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
     e.gamepad.index, e.gamepad.id,
     e.gamepad.buttons.length, e.gamepad.axes.length);
@@ -37,14 +37,14 @@ 

Disconnecting a gamepad

When a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g. {{ domxref("Window/gamepadconnected_event", "gamepadconnected") }}), a second event is dispatched to the focused window, {{ event("gamepaddisconnected") }}:

-
window.addEventListener("gamepaddisconnected", function(e) {
+
window.addEventListener("gamepaddisconnected", function(e) {
   console.log("Gamepad disconnected from index %d: %s",
     e.gamepad.index, e.gamepad.id);
 });

The gamepad's {{domxref("Gamepad.index", "index")}} property will be unique per-device connected to the system, even if multiple controllers of the same type are used. The index property also functions as the index into the {{jsxref("Array")}} returned by {{ domxref("Navigator.getGamepads()") }}.

-
var gamepads = {};
+
var gamepads = {};
 
 function gamepadHandler(event, connecting) {
   var gamepad = event.gamepad;
@@ -72,7 +72,7 @@ 

Querying the Gamepad object

The {{domxref("Navigator.getGamepads()")}} method returns an array of all devices currently visible to the webpage, as {{ domxref("Gamepad") }} objects (the first value is always null, so null will be returned if there are no gamepads connected.) This can then be used to get the same information. For example, the first code example above you be rewritten as shown below:

-
window.addEventListener("gamepadconnected", function(e) {
+
window.addEventListener("gamepadconnected", function(e) {
   var gp = navigator.getGamepads()[e.gamepad.index];
   console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
     gp.index, gp.id,
@@ -106,7 +106,7 @@ 

Using button information

To start with, we declare some variables: The gamepadInfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the ID for requestAnimation Frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the {{ domxref("Window.requestAnimationFrame", "requestAnimationFrame()") }} and {{ domxref("Window.cancelAnimationFrame", "cancelAnimationFrame()") }} cross browser forks.

-
var gamepadInfo = document.getElementById("gamepad-info");
+
var gamepadInfo = document.getElementById("gamepad-info");
 var ball = document.getElementById("ball");
 var start;
 var a = 0;
@@ -115,7 +115,7 @@ 

Using button information

Next we use the {{domxref("Window/gamepadconnected_event", "gamepadconnected")}} event to check for a gamepad being connected. When one is connected, we grab the gamepad using {{ domxref("Navigator.getGamepads()") }}[0], print information about the gamepad into our gamepad info div, and fire the gameLoop() function that starts the whole ball movement process up.

-
window.addEventListener("gamepadconnected", function(e) {
+
window.addEventListener("gamepadconnected", function(e) {
   var gp = navigator.getGamepads()[e.gamepad.index];
   gamepadInfo.innerHTML = "Gamepad connected at index " + gp.index + ": " + gp.id + ". It has " + gp.buttons.length + " buttons and " + gp.axes.length + " axes.";
 
@@ -124,7 +124,7 @@ 

Using button information

Now we use the {{domxref("Window/gamepaddisconnected_event", "gamepaddisconnected")}} event to check if the gamepad is disconnected again. If so, we stop the {{DOMxRef("Window.requestAnimationFrame", "requestAnimationFrame()")}} loop (see below) and revert the gamepad information back to what it was originally.

-
window.addEventListener("gamepaddisconnected", function(e) {
+
window.addEventListener("gamepaddisconnected", function(e) {
   gamepadInfo.innerHTML = "Waiting for gamepad.";
 
   cancelRequestAnimationFrame(start);
@@ -132,7 +132,7 @@ 

Using button information

Chrome does things differently here. Instead of constantly storing the gamepad's latest state in a variable it only stores a snapshot, so to do the same thing in Chrome you have to keep polling it and then only use the {{ domxref("Gamepad") }} object in code when it is available. We have done this below using {{ domxref("Window.setInterval()") }}; once the object is available the gamepad info is outputted, the game loop is started, and the interval is cleared using {{ domxref("Window.clearInterval()") }}. Note that in older versions of Chrome {{ domxref("Navigator.getGamepads()") }} is implemented with a webkit prefix. We attempt to detect and handle both the prefixed version and the standard version of the function for backwards compatibility.

-
var interval;
+
var interval;
 
 if (!('ongamepadconnected' in window)) {
   // No gamepad events available, poll instead.
@@ -156,7 +156,7 @@ 

Using button information

After all this is done, we use our requestAnimationFrame() to request the next animation frame, running gameLoop() again.

-
function buttonPressed(b) {
+
function buttonPressed(b) {
   if (typeof(b) == "object") {
     return b.pressed;
   }
@@ -191,7 +191,7 @@ 

Complete example: Displaying

This example shows how to use the {{ domxref("Gamepad") }} object, as well as the {{ domxref("Window/gamepadconnected_event", "gamepadconnected") }} and {{domxref("Window/gamepaddisconnected_event", "gamepaddisconnected")}} events in order to display the state of all gamepads connected to the system. You can find a working demo and look at the full source code on Github.

-
var haveEvents = 'ongamepadconnected' in window;
+
var haveEvents = 'ongamepadconnected' in window;
 var controllers = {};
 
 function connecthandler(e) {
diff --git a/files/en-us/web/api/gamepadevent/gamepad/index.html b/files/en-us/web/api/gamepadevent/gamepad/index.html
index b0f9c334f30b91a..cd9cbd2b2309a3f 100644
--- a/files/en-us/web/api/gamepadevent/gamepad/index.html
+++ b/files/en-us/web/api/gamepadevent/gamepad/index.html
@@ -17,7 +17,7 @@
 
 

Syntax

-
readonly    attribute Gamepad gamepad;
+
readonly    attribute Gamepad gamepad;

Example

diff --git a/files/en-us/web/api/gamepadevent/gamepadevent/index.html b/files/en-us/web/api/gamepadevent/gamepadevent/index.html index dd18c4c6cbeeee3..b07482b1adeabd2 100644 --- a/files/en-us/web/api/gamepadevent/gamepadevent/index.html +++ b/files/en-us/web/api/gamepadevent/gamepadevent/index.html @@ -16,7 +16,7 @@

Syntax

var gamepadEvent = new GamepadEvent(typeArg, options)
+ class="brush: js">var gamepadEvent = new GamepadEvent(typeArg, options)

Parameters

diff --git a/files/en-us/web/api/geolocation/clearwatch/index.html b/files/en-us/web/api/geolocation/clearwatch/index.html index c1770d1c923d1a2..e87346df9aea1d9 100644 --- a/files/en-us/web/api/geolocation/clearwatch/index.html +++ b/files/en-us/web/api/geolocation/clearwatch/index.html @@ -18,7 +18,7 @@

Syntax

-
navigator.geolocation.clearWatch(id);
+
navigator.geolocation.clearWatch(id);

Parameters

@@ -30,7 +30,7 @@

Parameters

Example

-
var id, target, option;
+
var id, target, option;
 
 function success(pos) {
   var crd = pos.coords;
diff --git a/files/en-us/web/api/geolocation/getcurrentposition/index.html b/files/en-us/web/api/geolocation/getcurrentposition/index.html
index cf7f64505258c82..99a93a0dfb1118e 100644
--- a/files/en-us/web/api/geolocation/getcurrentposition/index.html
+++ b/files/en-us/web/api/geolocation/getcurrentposition/index.html
@@ -19,7 +19,7 @@
 

Syntax

navigator.geolocation.getCurrentPosition(success[, error[, [options]])
+ class="brush: js">navigator.geolocation.getCurrentPosition(success[, error[, [options]])

Parameters

@@ -45,7 +45,7 @@

Parameters

Examples

-
var options = {
+
var options = {
   enableHighAccuracy: true,
   timeout: 5000,
   maximumAge: 0
diff --git a/files/en-us/web/api/geolocation/watchposition/index.html b/files/en-us/web/api/geolocation/watchposition/index.html
index 51ebe14e74e9299..87f1bf836257581 100644
--- a/files/en-us/web/api/geolocation/watchposition/index.html
+++ b/files/en-us/web/api/geolocation/watchposition/index.html
@@ -20,7 +20,7 @@
 

Syntax

navigator.geolocation.watchPosition(success[, error[, options]])
+ class="brush: js">navigator.geolocation.watchPosition(success[, error[, options]])

Parameters

@@ -43,7 +43,7 @@

Return value

Examples

-
var id, target, options;
+
var id, target, options;
 
 function success(pos) {
   var crd = pos.coords;
diff --git a/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html b/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html
index 859ecedd588d3b9..0f366e1fb5f54f3 100644
--- a/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html
+++ b/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html
@@ -16,7 +16,7 @@ 

The geolocation object

If the object exists, geolocation services are available. You can test for the presence of geolocation thusly:

-
if('geolocation' in navigator) {
+
if('geolocation' in navigator) {
   /* geolocation is available */
 } else {
   /* geolocation IS NOT available */
@@ -31,7 +31,7 @@ 

Getting the current position

Note: By default, {{domxref("Geolocation.getCurrentPosition","getCurrentPosition()")}} tries to answer as fast as possible with a low accuracy result. It is useful if you need a quick answer regardless of the accuracy. Devices with a GPS, for example, can take a minute or more to get a GPS fix, so less accurate data (IP location or wifi) may be returned to getCurrentPosition().

-
navigator.geolocation.getCurrentPosition((position) => {
+
navigator.geolocation.getCurrentPosition((position) => {
   doSomething(position.coords.latitude, position.coords.longitude);
 });
@@ -45,13 +45,13 @@

Watching the current position

Note: You can use {{domxref("Geolocation.watchPosition","watchPosition()")}} without an initial {{domxref("Geolocation.getCurrentPosition","getCurrentPosition()")}} call.

-
const watchID = navigator.geolocation.watchPosition((position) => {
+
const watchID = navigator.geolocation.watchPosition((position) => {
   doSomething(position.coords.latitude, position.coords.longitude);
 });

The {{domxref("Geolocation.watchPosition","watchPosition()")}} method returns an ID number that can be used to uniquely identify the requested position watcher; you use this value in tandem with the {{domxref("Geolocation.clearWatch","clearWatch()")}} method to stop watching the user's location.

-
navigator.geolocation.clearWatch(watchID);
+
navigator.geolocation.clearWatch(watchID);
 

Fine tuning the response

@@ -62,7 +62,7 @@

Fine tuning the response

A call to {{domxref("Geolocation.watchPosition","watchPosition")}} could look like:

-
function success(position) {
+
function success(position) {
   doSomething(position.coords.latitude, position.coords.longitude);
 }
 
@@ -86,7 +86,7 @@ 

Describing a position

The GeolocationCoordinates instance contains a number of properties, but the two you'll use most commonly are latitude and longitude, which are what you need to draw your position on a map. Hence many Geolocation success callbacks look fairly simple:

-
function success(position) {
+
function success(position) {
   const latitude  = position.coords.latitude;
   const longitude = position.coords.longitude;
 
@@ -101,7 +101,7 @@ 

Handling errors

You could use it like so:

-
function errorCallback(error) {
+
function errorCallback(error) {
   alert(`ERROR(${error.code}): ${error.message}`);
 };
 
@@ -111,7 +111,7 @@

Examples

In the following example the Geolocation API is used to retrieve the user's latitude and longitude. If sucessful, the available hyperlink is populated with an openstreetmap.org URL that will show their location.

JavaScript:

history.replaceState(stateObj, '', 'bar2.html');
+ class="brush: js line-numbers language-js">history.replaceState(stateObj, '', 'bar2.html');

This will cause the URL bar to display https://www.mozilla.org/bar2.html, but won't cause the browser diff --git a/files/en-us/web/api/history/scrollrestoration/index.html b/files/en-us/web/api/history/scrollrestoration/index.html index e7cc5b061f78175..9b47e9675b0ca0b 100644 --- a/files/en-us/web/api/history/scrollrestoration/index.html +++ b/files/en-us/web/api/history/scrollrestoration/index.html @@ -18,7 +18,7 @@

Syntax

const scrollRestore = history.scrollRestoration
+ class="brush: js">const scrollRestore = history.scrollRestoration

Values

diff --git a/files/en-us/web/api/history/state/index.html b/files/en-us/web/api/history/state/index.html index b0b019a22d088ef..5ebd5ee7060a824 100644 --- a/files/en-us/web/api/history/state/index.html +++ b/files/en-us/web/api/history/state/index.html @@ -18,7 +18,7 @@

Syntax

const currentState = history.state
+ class="brush: js">const currentState = history.state

Value

diff --git a/files/en-us/web/api/html_drag_and_drop_api/index.html b/files/en-us/web/api/html_drag_and_drop_api/index.html index a5632e512fa826b..c5c266b369ebb13 100644 --- a/files/en-us/web/api/html_drag_and_drop_api/index.html +++ b/files/en-us/web/api/html_drag_and_drop_api/index.html @@ -110,7 +110,7 @@

Identify what is draggable

Making an element draggable requires adding the {{htmlattrxref("draggable")}} attribute and the {{domxref("GlobalEventHandlers.ondragstart","ondragstart")}} global event handler, as shown in the following code sample:

-
<script>
+
<script>
   function dragstart_handler(ev) {
     // Add the target element's id to the data transfer object
     ev.dataTransfer.setData("text/plain", ev.target.id);
@@ -139,7 +139,7 @@ 

Define the drag's data

Each {{domxref("DragEvent","drag event")}} has a {{domxref("DragEvent.dataTransfer","dataTransfer")}} property that holds the event's data. This property (which is a {{domxref("DataTransfer")}} object) also has methods to manage drag data. The {{domxref("DataTransfer.setData","setData()")}} method is used to add an item to the drag data, as shown in the following example.

-
function dragstart_handler(ev) {
+
function dragstart_handler(ev) {
   // Add different types of drag data
   ev.dataTransfer.setData("text/plain", ev.target.innerText);
   ev.dataTransfer.setData("text/html", ev.target.outerHTML);
@@ -156,7 +156,7 @@ 

Define the drag image

By default, the browser supplies an image that appears beside the pointer during a drag operation. However, an application may define a custom image with the {{domxref("DataTransfer.setDragImage","setDragImage()")}} method, as shown in the following example.

-
function dragstart_handler(ev) {
+
function dragstart_handler(ev) {
   // Create an image and then use it for the drag image.
   // NOTE: change "example.gif" to a real image URL or the image
   // will not be created and the default drag image will be used.
@@ -188,7 +188,7 @@ 

Define the drag effect

The following example shows how to use this property.

-
function dragstart_handler(ev) {
+
function dragstart_handler(ev) {
   ev.dataTransfer.dropEffect = "copy";
 }
 
@@ -205,7 +205,7 @@

Define a drop zone

The following example shows how to use those attributes, and includes basic event handlers for each attribute.

-
<script>
+
<script>
 function dragover_handler(ev) {
  ev.preventDefault();
  ev.dataTransfer.dropEffect = "move";
@@ -237,7 +237,7 @@ 

Handle the drop effect

The following example shows a drop handler getting the source element's id from the drag data, and then using the id to move the source element to the drop element:

-
<script>
+
<script>
 function dragstart_handler(ev) {
  // Add the target element's id to the data transfer object
  ev.dataTransfer.setData("application/my-app", ev.target.id);
diff --git a/files/en-us/web/api/htmlaudioelement/audio/index.html b/files/en-us/web/api/htmlaudioelement/audio/index.html
index d66389246fb3027..5c99de1de8d7850 100644
--- a/files/en-us/web/api/htmlaudioelement/audio/index.html
+++ b/files/en-us/web/api/htmlaudioelement/audio/index.html
@@ -22,7 +22,7 @@
 

Syntax

audioObj = new Audio(url);
+ class="brush: js">audioObj = new Audio(url);

Parameters

diff --git a/files/en-us/web/api/htmlbuttonelement/labels/index.html b/files/en-us/web/api/htmlbuttonelement/labels/index.html index bff6effc2217367..1fde128d83b6dfc 100644 --- a/files/en-us/web/api/htmlbuttonelement/labels/index.html +++ b/files/en-us/web/api/htmlbuttonelement/labels/index.html @@ -15,7 +15,7 @@

Syntax

-
var labelElements = button.labels;
+
var labelElements = button.labels;
 

Return value

diff --git a/files/en-us/web/api/htmlformelement/acceptcharset/index.html b/files/en-us/web/api/htmlformelement/acceptcharset/index.html index 16bcb4e4ac7b4f3..fcd92d235ec76ee 100644 --- a/files/en-us/web/api/htmlformelement/acceptcharset/index.html +++ b/files/en-us/web/api/htmlformelement/acceptcharset/index.html @@ -19,7 +19,7 @@

Syntax

-
var string = form.acceptCharset;
+
var string = form.acceptCharset;
 form.acceptCharset = string;
 
diff --git a/files/en-us/web/api/htmlformelement/action/index.html b/files/en-us/web/api/htmlformelement/action/index.html index c1ef04d0bb94f2f..df2a27612884d01 100644 --- a/files/en-us/web/api/htmlformelement/action/index.html +++ b/files/en-us/web/api/htmlformelement/action/index.html @@ -21,7 +21,7 @@

Syntax

-
var string = form.action;
+
var string = form.action;
 form.action = string;
 
diff --git a/files/en-us/web/api/htmlformelement/elements/index.html b/files/en-us/web/api/htmlformelement/elements/index.html index 7746303521f11c2..dd00270ae34f527 100644 --- a/files/en-us/web/api/htmlformelement/elements/index.html +++ b/files/en-us/web/api/htmlformelement/elements/index.html @@ -34,7 +34,7 @@

Syntax

-
nodeList = HTMLFormElement.elements
+
nodeList = HTMLFormElement.elements
 

Value

diff --git a/files/en-us/web/api/htmlformelement/enctype/index.html b/files/en-us/web/api/htmlformelement/enctype/index.html index 5696f2a71db4a19..aeccf4303f2df04 100644 --- a/files/en-us/web/api/htmlformelement/enctype/index.html +++ b/files/en-us/web/api/htmlformelement/enctype/index.html @@ -27,7 +27,7 @@

Syntax

-
var string = form.enctype;
+
var string = form.enctype;
 form.enctype = string;
 
diff --git a/files/en-us/web/api/htmlformelement/index.html b/files/en-us/web/api/htmlformelement/index.html index 99b4f72bf2ef543..97e1eee96fdb768 100644 --- a/files/en-us/web/api/htmlformelement/index.html +++ b/files/en-us/web/api/htmlformelement/index.html @@ -149,7 +149,7 @@

Examples

Creating a new form element, modifying its attributes, then submitting it:

-
const f = document.createElement("form"); // Create a form
+
const f = document.createElement("form"); // Create a form
 document.body.appendChild(f);             // Add it to the document body
 f.action = "/cgi-bin/some.cgi";           // Add action and method attributes
 f.method = "POST";
@@ -158,7 +158,7 @@ 

Examples

Extract information from a <form> element and set some of its attributes:

-
<form name="formA" action="/cgi-bin/test" method="post">
+
<form name="formA" action="/cgi-bin/test" method="post">
  <p>Press "Info" for form details, or "Set" to change those details.</p>
  <p>
   <button type="button" onclick="getFormInfo();">Info</button>
@@ -191,7 +191,7 @@ 

Examples

Submit a <form> into a new window:

-
<!doctype html>
+
<!doctype html>
 <html>
 <head>
 <meta charset="utf-8">
diff --git a/files/en-us/web/api/htmlformelement/length/index.html b/files/en-us/web/api/htmlformelement/length/index.html
index f4b03e432a27242..708c032e8ab28a7 100644
--- a/files/en-us/web/api/htmlformelement/length/index.html
+++ b/files/en-us/web/api/htmlformelement/length/index.html
@@ -28,7 +28,7 @@
 
 

Syntax

-
numControls = form.length;
+
numControls = form.length;
 

Value

diff --git a/files/en-us/web/api/htmlformelement/method/index.html b/files/en-us/web/api/htmlformelement/method/index.html index eab705a289dcc50..7f240170f826741 100644 --- a/files/en-us/web/api/htmlformelement/method/index.html +++ b/files/en-us/web/api/htmlformelement/method/index.html @@ -18,7 +18,7 @@

Syntax

-
var string = form.method;
+
var string = form.method;
 form.method = string;
 
diff --git a/files/en-us/web/api/htmlformelement/name/index.html b/files/en-us/web/api/htmlformelement/name/index.html index 2a19d5a6e598dea..8220e21ad856b64 100644 --- a/files/en-us/web/api/htmlformelement/name/index.html +++ b/files/en-us/web/api/htmlformelement/name/index.html @@ -22,7 +22,7 @@

Syntax

-
var string = form.name;
+
var string = form.name;
 form.name = string;

Example

diff --git a/files/en-us/web/api/htmlformelement/reportvalidity/index.html b/files/en-us/web/api/htmlformelement/reportvalidity/index.html index 8f58945573c49e1..5b05218b5db9b87 100644 --- a/files/en-us/web/api/htmlformelement/reportvalidity/index.html +++ b/files/en-us/web/api/htmlformelement/reportvalidity/index.html @@ -17,7 +17,7 @@

Syntax

-
HTMLFormElement.reportValidity()
+
HTMLFormElement.reportValidity()
 

Return value

diff --git a/files/en-us/web/api/htmlformelement/requestsubmit/index.html b/files/en-us/web/api/htmlformelement/requestsubmit/index.html index 0a49d0a32ecf7ea..2fe616677dc1b6e 100644 --- a/files/en-us/web/api/htmlformelement/requestsubmit/index.html +++ b/files/en-us/web/api/htmlformelement/requestsubmit/index.html @@ -22,7 +22,7 @@

Syntax

htmlFormElement.requestSubmit(submitter);
+ class="brush: js">htmlFormElement.requestSubmit(submitter);

Parameters

diff --git a/files/en-us/web/api/htmlformelement/reset/index.html b/files/en-us/web/api/htmlformelement/reset/index.html index fe2cd1cd0b55ee0..6821cd868fa0d5a 100644 --- a/files/en-us/web/api/htmlformelement/reset/index.html +++ b/files/en-us/web/api/htmlformelement/reset/index.html @@ -22,7 +22,7 @@

Syntax

-
HTMLFormElement.reset()
+
HTMLFormElement.reset()
 

Example

diff --git a/files/en-us/web/api/htmlformelement/reset_event/index.html b/files/en-us/web/api/htmlformelement/reset_event/index.html index 94f87890ff06646..b84f9f51dda9e23 100644 --- a/files/en-us/web/api/htmlformelement/reset_event/index.html +++ b/files/en-us/web/api/htmlformelement/reset_event/index.html @@ -40,7 +40,7 @@

Examples

HTML

-
<form id="form">
+
<form id="form">
   <label>Test field: <input type="text"></label>
   <br><br>
   <button type="reset">Reset form</button>
@@ -49,7 +49,7 @@ 

HTML

JavaScript

-
function logReset(event) {
+
function logReset(event) {
   log.textContent = `Form reset! Time stamp: ${event.timeStamp}`;
 }
 
diff --git a/files/en-us/web/api/htmlformelement/submit/index.html b/files/en-us/web/api/htmlformelement/submit/index.html
index 35f0acfda43115d..5330d1cefc1b418 100644
--- a/files/en-us/web/api/htmlformelement/submit/index.html
+++ b/files/en-us/web/api/htmlformelement/submit/index.html
@@ -36,7 +36,7 @@
 
 

Syntax

-
HTMLFormElement.submit()
+
HTMLFormElement.submit()
 

Example

diff --git a/files/en-us/web/api/htmlformelement/submit_event/index.html b/files/en-us/web/api/htmlformelement/submit_event/index.html index e1b8eb83cd7c70d..51991f1005dadab 100644 --- a/files/en-us/web/api/htmlformelement/submit_event/index.html +++ b/files/en-us/web/api/htmlformelement/submit_event/index.html @@ -49,7 +49,7 @@

Examples

HTML

-
<form id="form">
+
<form id="form">
   <label>Test field: <input type="text"></label>
   <br><br>
   <button type="submit">Submit form</button>
@@ -58,7 +58,7 @@ 

HTML

JavaScript

-
function logSubmit(event) {
+
function logSubmit(event) {
   log.textContent = `Form Submitted! Time stamp: ${event.timeStamp}`;
   event.preventDefault();
 }
diff --git a/files/en-us/web/api/htmlformelement/target/index.html b/files/en-us/web/api/htmlformelement/target/index.html
index 364930b66c50a61..f9e359610a29497 100644
--- a/files/en-us/web/api/htmlformelement/target/index.html
+++ b/files/en-us/web/api/htmlformelement/target/index.html
@@ -17,7 +17,7 @@
 
 

Syntax

-
string = HTMLFormElement.target
+
string = HTMLFormElement.target
 HTMLFormElement.target = string
 
diff --git a/files/en-us/web/api/htmlimageelement/align/index.html b/files/en-us/web/api/htmlimageelement/align/index.html index 251fbdb0e820f1a..fe153c6ecfb61b3 100644 --- a/files/en-us/web/api/htmlimageelement/align/index.html +++ b/files/en-us/web/api/htmlimageelement/align/index.html @@ -29,7 +29,7 @@

Syntax

-
htmlImageElement.align = alignMode;
+
htmlImageElement.align = alignMode;
 alignMode = htmlImageElement.align;
 
diff --git a/files/en-us/web/api/htmlimageelement/alt/index.html b/files/en-us/web/api/htmlimageelement/alt/index.html index 623ebe26187a20b..09797a09f748e8d 100644 --- a/files/en-us/web/api/htmlimageelement/alt/index.html +++ b/files/en-us/web/api/htmlimageelement/alt/index.html @@ -40,7 +40,7 @@

Syntax

-
htmlImageElement.alt = altText;
+
htmlImageElement.alt = altText;
 let altText = htmlImageElement.alt;

Value

diff --git a/files/en-us/web/api/htmlimageelement/border/index.html b/files/en-us/web/api/htmlimageelement/border/index.html index 5cc3d0d4e28bdd6..7cbddec68aed74e 100644 --- a/files/en-us/web/api/htmlimageelement/border/index.html +++ b/files/en-us/web/api/htmlimageelement/border/index.html @@ -36,7 +36,7 @@

Syntax

-
htmlImageElement.border = thickness;
+
htmlImageElement.border = thickness;
 let thickness = htmlImageElement.border;
 
diff --git a/files/en-us/web/api/htmlimageelement/complete/index.html b/files/en-us/web/api/htmlimageelement/complete/index.html index 1ad89924a1c4eea..5aad0abc2ce5949 100644 --- a/files/en-us/web/api/htmlimageelement/complete/index.html +++ b/files/en-us/web/api/htmlimageelement/complete/index.html @@ -21,7 +21,7 @@

Syntax

let doneLoading = htmlImageElement.complete;
+ class="brush: js">let doneLoading = htmlImageElement.complete;

Value

@@ -63,7 +63,7 @@

Examples

image's complete property before attempting to do its work. This is demonstrated in the code below.

-
let lightboxElem = document.querySelector("#lightbox");
+
let lightboxElem = document.querySelector("#lightbox");
 let lightboxImgElem = lightboxElem.querySelector("img");
 let lightboxControlsElem = lightboxElem.querySelector(".toolbar");
 
diff --git a/files/en-us/web/api/htmlimageelement/crossorigin/index.html b/files/en-us/web/api/htmlimageelement/crossorigin/index.html
index 44a14dbfe500ef2..9019a0110bbc6da 100644
--- a/files/en-us/web/api/htmlimageelement/crossorigin/index.html
+++ b/files/en-us/web/api/htmlimageelement/crossorigin/index.html
@@ -23,7 +23,7 @@
 
 

Syntax

-
htmlImageElement.crossOrigin = crossOriginMode;
+
htmlImageElement.crossOrigin = crossOriginMode;
 let crossOriginMode = htmlImageElement.crossOrigin;

Value

@@ -62,7 +62,7 @@

JavaScript

<img> element to configure CORS access for the fetch of a newly-created image.

-
const imageUrl = "https://mdn.mozillademos.org/files/16797/clock-demo-400px.png";
+
const imageUrl = "https://mdn.mozillademos.org/files/16797/clock-demo-400px.png";
 const container = document.querySelector(".container");
 
 function loadImage(url) {
@@ -86,7 +86,7 @@ 

JavaScript

HTML

-
<div class="container">
+
<div class="container">
   <p>Here's a paragraph. It's a very interesting paragraph. You
   are captivated by this paragraph. Keep reading this paragraph.
   Okay, now you can stop reading this paragraph. Thanks for
@@ -95,7 +95,7 @@ 

HTML

CSS

-
body {
+
body {
   font: 1.125rem/1.5, Helvetica, sans-serif;
 }
 
diff --git a/files/en-us/web/api/htmlimageelement/currentsrc/index.html b/files/en-us/web/api/htmlimageelement/currentsrc/index.html
index db1f3ce5fcb2553..5a978bcad62c1f6 100644
--- a/files/en-us/web/api/htmlimageelement/currentsrc/index.html
+++ b/files/en-us/web/api/htmlimageelement/currentsrc/index.html
@@ -20,7 +20,7 @@
 

Syntax

let currentSource = htmlImageElement.currentSrc;
+ class="brush: js">let currentSource = htmlImageElement.currentSrc;

Value

diff --git a/files/en-us/web/api/htmlimageelement/decode/index.html b/files/en-us/web/api/htmlimageelement/decode/index.html index 0b937dddf759dc4..6ba62644e559605 100644 --- a/files/en-us/web/api/htmlimageelement/decode/index.html +++ b/files/en-us/web/api/htmlimageelement/decode/index.html @@ -30,7 +30,7 @@

Syntax

var promise = HTMLImageElement.decode();
+ class="brush: js">var promise = HTMLImageElement.decode();

Parameters

diff --git a/files/en-us/web/api/htmlimageelement/decoding/index.html b/files/en-us/web/api/htmlimageelement/decoding/index.html index 96c962875e7d756..0b0ea68c3e623d0 100644 --- a/files/en-us/web/api/htmlimageelement/decoding/index.html +++ b/files/en-us/web/api/htmlimageelement/decoding/index.html @@ -17,7 +17,7 @@

Syntax

-
refStr = imgElem.decoding;
+
refStr = imgElem.decoding;
 imgElem.decoding = refStr;

Values

diff --git a/files/en-us/web/api/htmlimageelement/height/index.html b/files/en-us/web/api/htmlimageelement/height/index.html index 8f6ddaaa3266a28..93777396219681a 100644 --- a/files/en-us/web/api/htmlimageelement/height/index.html +++ b/files/en-us/web/api/htmlimageelement/height/index.html @@ -23,7 +23,7 @@

Syntax

-
htmlImageElement.height = newHeight;
+
htmlImageElement.height = newHeight;
 let height = htmlImageElement.height;

Value

@@ -51,7 +51,7 @@

HTML

Specifically, for viewports up to 400px wide, the image is drawn at a width of 200px; otherwise, it's drawn at 300px.

-
<p>Image height: <span class="size">?</span>px (resize to update)</p>
+
<p>Image height: <span class="size">?</span>px (resize to update)</p>
 <img src="/files/17373/clock-demo-200px.png"
       alt="Clock"
       srcset="/files/17373/clock-demo-200px.png 200w,
@@ -63,7 +63,7 @@ 

JavaScript

The JavaScript code looks at the height to determine the height of the image given the width at which it's currently drawn.

-
var clockImage = document.querySelector("img");
+
var clockImage = document.querySelector("img");
 let output = document.querySelector(".size");
 
 const updateHeight = event => { output.innerText = clockImage.height; };
diff --git a/files/en-us/web/api/htmlimageelement/hspace/index.html b/files/en-us/web/api/htmlimageelement/hspace/index.html
index a65af670c6092fc..0c4111ab50208a7 100644
--- a/files/en-us/web/api/htmlimageelement/hspace/index.html
+++ b/files/en-us/web/api/htmlimageelement/hspace/index.html
@@ -32,7 +32,7 @@
 
 

Syntax

-
htmlImageElement.hspace = marginWidth;
+
htmlImageElement.hspace = marginWidth;
 marginWidth = htmlImageElement.hspace;
 
diff --git a/files/en-us/web/api/htmlimageelement/image/index.html b/files/en-us/web/api/htmlimageelement/image/index.html index 826b32f674b14d5..f76ca812c032b5f 100644 --- a/files/en-us/web/api/htmlimageelement/image/index.html +++ b/files/en-us/web/api/htmlimageelement/image/index.html @@ -28,7 +28,7 @@

Syntax

var htmlImageElement = new Image(width, height);
+ class="brush: js">var htmlImageElement = new Image(width, height);

Parameters

diff --git a/files/en-us/web/api/htmlimageelement/index.html b/files/en-us/web/api/htmlimageelement/index.html index 9774ae1a566a4db..18f67b51211dad9 100644 --- a/files/en-us/web/api/htmlimageelement/index.html +++ b/files/en-us/web/api/htmlimageelement/index.html @@ -111,7 +111,7 @@

Errors

Example

-
var img1 = new Image(); // Image constructor
+
var img1 = new Image(); // Image constructor
 img1.src = 'image1.png';
 img1.alt = 'alt';
 document.body.appendChild(img1);
diff --git a/files/en-us/web/api/htmlimageelement/ismap/index.html b/files/en-us/web/api/htmlimageelement/ismap/index.html
index 02c50d142f0cf35..ef4da620798e82f 100644
--- a/files/en-us/web/api/htmlimageelement/ismap/index.html
+++ b/files/en-us/web/api/htmlimageelement/ismap/index.html
@@ -27,7 +27,7 @@
 
 

Syntax

-
htmlImageElement.isMap = true|false;
+
htmlImageElement.isMap = true|false;
 let isMap = htmlImageElement.isMap;
 
diff --git a/files/en-us/web/api/htmlimageelement/loading/index.html b/files/en-us/web/api/htmlimageelement/loading/index.html index c54c7acdac5fea2..c739783b879e7b9 100644 --- a/files/en-us/web/api/htmlimageelement/loading/index.html +++ b/files/en-us/web/api/htmlimageelement/loading/index.html @@ -31,7 +31,7 @@

Syntax

-
let imageLoadScheduling = htmlImageElement.loading;
+
let imageLoadScheduling = htmlImageElement.loading;
 htmlImageElement.loading = eagerOrLazy;
 
@@ -96,7 +96,7 @@

Example

of items, using lazy-loading to avoid loading the image from the network until it's actually needed.

-
function addImageToList(url) {
+
function addImageToList(url) {
   const list = document.querySelector("div.photo-list");
 
   let newItem = document.createElement("div");
diff --git a/files/en-us/web/api/htmlimageelement/longdesc/index.html b/files/en-us/web/api/htmlimageelement/longdesc/index.html
index 4d76a49ff8107ef..7ed4d640839d21d 100644
--- a/files/en-us/web/api/htmlimageelement/longdesc/index.html
+++ b/files/en-us/web/api/htmlimageelement/longdesc/index.html
@@ -25,7 +25,7 @@
 
 

Syntax

-
descURL = htmlImageElement.longDesc;
+
descURL = htmlImageElement.longDesc;
 htmlImageElement.longDesc = descURL;
 
diff --git a/files/en-us/web/api/htmlimageelement/lowsrc/index.html b/files/en-us/web/api/htmlimageelement/lowsrc/index.html index 04995e457bf6ad2..922c907409ff473 100644 --- a/files/en-us/web/api/htmlimageelement/lowsrc/index.html +++ b/files/en-us/web/api/htmlimageelement/lowsrc/index.html @@ -29,7 +29,7 @@

Syntax

-
htmlImageElement.lowsrc = imageUrl;
+
htmlImageElement.lowsrc = imageUrl;
 imageUrl = htmlImageElement.lowsrc;
 
diff --git a/files/en-us/web/api/htmlimageelement/name/index.html b/files/en-us/web/api/htmlimageelement/name/index.html index e3044114141b7b3..885a53938ec7bc2 100644 --- a/files/en-us/web/api/htmlimageelement/name/index.html +++ b/files/en-us/web/api/htmlimageelement/name/index.html @@ -22,7 +22,7 @@

Syntax

-
htmlImageElement.name = nameString;
+
htmlImageElement.name = nameString;
 nameString = htmlImageElement.name;
 
diff --git a/files/en-us/web/api/htmlimageelement/naturalheight/index.html b/files/en-us/web/api/htmlimageelement/naturalheight/index.html index 1497bcb4fc25843..c3f871f29db411e 100644 --- a/files/en-us/web/api/htmlimageelement/naturalheight/index.html +++ b/files/en-us/web/api/htmlimageelement/naturalheight/index.html @@ -23,7 +23,7 @@

Syntax

let naturalHeight = htmlImageElement.naturalHeight;
+ class="brush: js">let naturalHeight = htmlImageElement.naturalHeight;

Value

diff --git a/files/en-us/web/api/htmlimageelement/naturalwidth/index.html b/files/en-us/web/api/htmlimageelement/naturalwidth/index.html index f9d05fc3f0f6353..d04e9c24fbb75ca 100644 --- a/files/en-us/web/api/htmlimageelement/naturalwidth/index.html +++ b/files/en-us/web/api/htmlimageelement/naturalwidth/index.html @@ -30,7 +30,7 @@

Syntax

let naturalWidth = htmlImageElement.naturalWidth;
+ class="brush: js">let naturalWidth = htmlImageElement.naturalWidth;

Value

diff --git a/files/en-us/web/api/htmlimageelement/referrerpolicy/index.html b/files/en-us/web/api/htmlimageelement/referrerpolicy/index.html index bc3e07a8af3a81b..2ea5c169b7652ff 100644 --- a/files/en-us/web/api/htmlimageelement/referrerpolicy/index.html +++ b/files/en-us/web/api/htmlimageelement/referrerpolicy/index.html @@ -18,7 +18,7 @@

Syntax

-
refStr = imgElt.referrerPolicy;
+
refStr = imgElt.referrerPolicy;
 imgElt.referrerPolicy = refStr;

Values

diff --git a/files/en-us/web/api/htmlimageelement/sizes/index.html b/files/en-us/web/api/htmlimageelement/sizes/index.html index 5e14494449a8478..1e8206572f93eb5 100644 --- a/files/en-us/web/api/htmlimageelement/sizes/index.html +++ b/files/en-us/web/api/htmlimageelement/sizes/index.html @@ -26,7 +26,7 @@

Syntax

-
let sizes = htmlImageElement.sizes;
+
let sizes = htmlImageElement.sizes;
 htmlImageElement.sizes = sizes;
 
diff --git a/files/en-us/web/api/htmlimageelement/src/index.html b/files/en-us/web/api/htmlimageelement/src/index.html index f10e19af356c0bd..f979ce7e924b220 100644 --- a/files/en-us/web/api/htmlimageelement/src/index.html +++ b/files/en-us/web/api/htmlimageelement/src/index.html @@ -23,7 +23,7 @@

Syntax

-
htmlImageElement.src = newSource;
+
htmlImageElement.src = newSource;
 let src = htmlImageElement.src;

Value

diff --git a/files/en-us/web/api/htmlimageelement/srcset/index.html b/files/en-us/web/api/htmlimageelement/srcset/index.html index 0073f0e297eb6ff..d4c6bc7fca6b8a0 100644 --- a/files/en-us/web/api/htmlimageelement/srcset/index.html +++ b/files/en-us/web/api/htmlimageelement/srcset/index.html @@ -32,7 +32,7 @@

Syntax

-
htmlImageElement.srcset = imageCandidateStrings;
+
htmlImageElement.srcset = imageCandidateStrings;
 let srcset = htmlImageElement.srcset;
 
@@ -76,14 +76,14 @@

Value

are valid image candidate strings:

"images/team-photo.jpg 1x, images/team-photo-retina.jpg 2x, images/team-photo-full 2048w"
+ class="brush: html">"images/team-photo.jpg 1x, images/team-photo-retina.jpg 2x, images/team-photo-full 2048w"

This string provides versions of an image to be used at the standard pixel density (1x) as well as double that pixel density (2x). Also available is a version of the image for use at a width of 2048 pixels (2048w).

"header640.png 640w, header960.png 960w, header1024.png 1024w, header.png"
+ class="brush: html">"header640.png 640w, header960.png 960w, header1024.png 1024w, header.png"

This string provides versions of a header image to use when the {{Glossary("user agent", "user agent's")}} renderer needs an image of width 640px, 960px, or 1024px. An @@ -91,7 +91,7 @@

Value

used for any other width.

"icon32px.png 32w, icon64px.png 64w, icon-retina.png 2x, icon-ultra.png 3x, icon.svg"
+ class="brush: html">"icon32px.png 32w, icon64px.png 64w, icon-retina.png 2x, icon-ultra.png 3x, icon.svg"

Here, options are provided for an icon at widths of 32px and 64px, as well as at pixel densities of 2x and 3x. A fallback image is provided as an SVG file that should be used @@ -111,7 +111,7 @@

HTML

srcset attribute is that the 200-pixel version should be used for 1x displays while the 400-pixel version should be used for 2x displays.

-
<div class="box">
+
<div class="box">
   <img src="/files/16797/clock-demo-200px.png"
        alt="Clock"
        srcset="/files/16864/clock-demo-200px.png 1x, /files/16797/clock-demo-400px.png 2x">
@@ -126,7 +126,7 @@ 

CSS

browser to wrap the string within the width available regardless of where in the string the wrap must occur.

-
.box {
+
.box {
   width: 200px;
   border: 2px solid rgba(150, 150, 150, 255);
   padding: 0.5em;
@@ -144,7 +144,7 @@ 

JavaScript

{{domxref("HTMLImageElement.currentSrc", "currentSrc")}} property to fetch and display the URL selected by the browser from the srcset.

-
let box = document.querySelector(".box");
+
let box = document.querySelector(".box");
 let image = box.querySelector("img");
 
 let newElem = document.createElement("p");
diff --git a/files/en-us/web/api/htmlimageelement/usemap/index.html b/files/en-us/web/api/htmlimageelement/usemap/index.html
index 942723827372232..ded247280c39abf 100644
--- a/files/en-us/web/api/htmlimageelement/usemap/index.html
+++ b/files/en-us/web/api/htmlimageelement/usemap/index.html
@@ -24,7 +24,7 @@
 
 

Syntax

-
htmlImageElement.useMap = imageMapAnchor;
+
htmlImageElement.useMap = imageMapAnchor;
 let imageMapAnchor = htmlImageElement.useMap;
 
@@ -47,7 +47,7 @@

Usage notes

Consider a <map> that looks like this:

-
<map name="mainmenu-map">
+
<map name="mainmenu-map">
   <area shape="circle" coords="25, 25, 75" href="/index.html" alt="Return to home page">
   <area shape="rect" coords="25, 25, 100, 150" href="/index.html" alt="Shop">
 </map>
@@ -57,7 +57,7 @@ 

Usage notes

look something like the following:

<img src="menubox.png" usemap="#mainmenu-map">
+ class="brush: html"><img src="menubox.png" usemap="#mainmenu-map">

For additional examples (including interactive ones), see the articles about the {{HTMLElement("map")}} and {{HTMLElement("area")}} elements, as well as the Syntax

-
htmlImageElement.vspace = marginHeight;
+
htmlImageElement.vspace = marginHeight;
 marginHeight = htmlImageElement.vspace;
 
diff --git a/files/en-us/web/api/htmlimageelement/width/index.html b/files/en-us/web/api/htmlimageelement/width/index.html index 339f5bf3cb11835..b507765cd5ba321 100644 --- a/files/en-us/web/api/htmlimageelement/width/index.html +++ b/files/en-us/web/api/htmlimageelement/width/index.html @@ -22,7 +22,7 @@

Syntax

-
htmlImageElement.width = newWidth;
+
htmlImageElement.width = newWidth;
 let width = htmlImageElement.width;

Value

@@ -51,7 +51,7 @@

HTML

For viewports up to 400px wide, the image is drawn at a width of 200px. Otherwise, it's drawn at 400px.

-
<p>Image width: <span class="size">?</span>px (resize to update)</p>
+
<p>Image width: <span class="size">?</span>px (resize to update)</p>
 <img src="/files/16864/clock-demo-200px.png"
       alt="Clock"
       srcset="/files/16864/clock-demo-200px.png 200w,
@@ -65,7 +65,7 @@ 

JavaScript

"load")}} and {{domxref("Window.resize_event", "resize")}} event handlers so the most current width information is always available.

-
var clockImage = document.querySelector("img");
+
var clockImage = document.querySelector("img");
 let output = document.querySelector(".size");
 
 const updateWidth = event => { output.innerText = clockImage.width; };
diff --git a/files/en-us/web/api/htmlimageelement/x/index.html b/files/en-us/web/api/htmlimageelement/x/index.html
index bda66910b198eb5..b77c7e3b4133e4e 100644
--- a/files/en-us/web/api/htmlimageelement/x/index.html
+++ b/files/en-us/web/api/htmlimageelement/x/index.html
@@ -33,7 +33,7 @@
 

Syntax

let imageX = htmlImageElement.x;
+ class="brush: js">let imageX = htmlImageElement.x;

Value

diff --git a/files/en-us/web/api/htmlimageelement/y/index.html b/files/en-us/web/api/htmlimageelement/y/index.html index 87ef5b3a718e60e..56ddd04a616b801 100644 --- a/files/en-us/web/api/htmlimageelement/y/index.html +++ b/files/en-us/web/api/htmlimageelement/y/index.html @@ -19,7 +19,7 @@

Syntax

let imageY = htmlImageElement.y;
+ class="brush: js">let imageY = htmlImageElement.y;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/checkvalidity/index.html b/files/en-us/web/api/htmlobjectelement/checkvalidity/index.html index 774061c0abbd9f8..dcfa8febcbd30ac 100644 --- a/files/en-us/web/api/htmlobjectelement/checkvalidity/index.html +++ b/files/en-us/web/api/htmlobjectelement/checkvalidity/index.html @@ -19,7 +19,7 @@

Syntax

-
const valid = HTMLObjectElement.checkValidity();
+
const valid = HTMLObjectElement.checkValidity();

Parameters

diff --git a/files/en-us/web/api/htmlobjectelement/contentdocument/index.html b/files/en-us/web/api/htmlobjectelement/contentdocument/index.html index 6cc7b04890ccba7..99107b160a05cd4 100644 --- a/files/en-us/web/api/htmlobjectelement/contentdocument/index.html +++ b/files/en-us/web/api/htmlobjectelement/contentdocument/index.html @@ -20,7 +20,7 @@

Syntax

var document = HTMLObjectElement.contentDocument;
+ class="brush: js">var document = HTMLObjectElement.contentDocument;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/contentwindow/index.html b/files/en-us/web/api/htmlobjectelement/contentwindow/index.html index 03c39eed9b64fd7..23ab1821e9328a8 100644 --- a/files/en-us/web/api/htmlobjectelement/contentwindow/index.html +++ b/files/en-us/web/api/htmlobjectelement/contentwindow/index.html @@ -20,7 +20,7 @@

Syntax

var WindowProxy = HTMLObjectElement.contentWindow;
+ class="brush: js">var WindowProxy = HTMLObjectElement.contentWindow;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/data/index.html b/files/en-us/web/api/htmlobjectelement/data/index.html index 44bf6746d7767cc..92db29c762f6399 100644 --- a/files/en-us/web/api/htmlobjectelement/data/index.html +++ b/files/en-us/web/api/htmlobjectelement/data/index.html @@ -19,7 +19,7 @@

Syntax

-
var data = HTMLObjectElement.data;
+
var data = HTMLObjectElement.data;
 HTMLObjectElement.data;
 
diff --git a/files/en-us/web/api/htmlobjectelement/form/index.html b/files/en-us/web/api/htmlobjectelement/form/index.html index 0d47acaa9d97b52..60f40a300f439b3 100644 --- a/files/en-us/web/api/htmlobjectelement/form/index.html +++ b/files/en-us/web/api/htmlobjectelement/form/index.html @@ -19,7 +19,7 @@

Syntax

var HTMLFormElement = HTMLObjectElement.form;
+ class="brush: js">var HTMLFormElement = HTMLObjectElement.form;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/height/index.html b/files/en-us/web/api/htmlobjectelement/height/index.html index d3082cb68a7ec07..085d0c221a7dbc4 100644 --- a/files/en-us/web/api/htmlobjectelement/height/index.html +++ b/files/en-us/web/api/htmlobjectelement/height/index.html @@ -19,7 +19,7 @@

Syntax

-
var String = HTMLObjectElement.height;
+
var String = HTMLObjectElement.height;
 HTMLObjectElement.height = String;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/name/index.html b/files/en-us/web/api/htmlobjectelement/name/index.html index 1209ad59295ad0b..6486996c88217d7 100644 --- a/files/en-us/web/api/htmlobjectelement/name/index.html +++ b/files/en-us/web/api/htmlobjectelement/name/index.html @@ -19,7 +19,7 @@

Syntax

-
var String = HTMLObjectElement.name;
+
var String = HTMLObjectElement.name;
 HTMLObjectElement.name = String;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/setcustomvalidity/index.html b/files/en-us/web/api/htmlobjectelement/setcustomvalidity/index.html index 4825b9e024f575e..800cb7a382689b2 100644 --- a/files/en-us/web/api/htmlobjectelement/setcustomvalidity/index.html +++ b/files/en-us/web/api/htmlobjectelement/setcustomvalidity/index.html @@ -18,7 +18,7 @@

Syntax

-
HTMLObjectElement.setCustomValidity(message);
+
HTMLObjectElement.setCustomValidity(message);

Parameters

@@ -43,7 +43,7 @@

Examples

href="/en-US/docs/Web/API/HTMLFormElement/reportValidity">reportValidity
method on the same element or nothing will happen.

-
function validate(inputID)
+
function validate(inputID)
 {
  var input = document.getElementById(inputID);
  var validityState_object = input.validity;
diff --git a/files/en-us/web/api/htmlobjectelement/type/index.html b/files/en-us/web/api/htmlobjectelement/type/index.html
index e91c7302a4d3dca..f68c658dd508b57 100644
--- a/files/en-us/web/api/htmlobjectelement/type/index.html
+++ b/files/en-us/web/api/htmlobjectelement/type/index.html
@@ -19,7 +19,7 @@
 
 

Syntax

-
var String = HTMLObjectElement.type
+
var String = HTMLObjectElement.type
 HTMLObjectElement.type = String;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/typemustmatch/index.html b/files/en-us/web/api/htmlobjectelement/typemustmatch/index.html index c08f05648ec4952..d49ce7f64b399c8 100644 --- a/files/en-us/web/api/htmlobjectelement/typemustmatch/index.html +++ b/files/en-us/web/api/htmlobjectelement/typemustmatch/index.html @@ -19,7 +19,7 @@

Syntax

-
var mustMatch = obj.typeMustMatch;
+
var mustMatch = obj.typeMustMatch;
 obj.typeMustMatch = mustMatch;
 
diff --git a/files/en-us/web/api/htmlobjectelement/usemap/index.html b/files/en-us/web/api/htmlobjectelement/usemap/index.html index 199b9beeee63883..423f6ad06fc6727 100644 --- a/files/en-us/web/api/htmlobjectelement/usemap/index.html +++ b/files/en-us/web/api/htmlobjectelement/usemap/index.html @@ -19,7 +19,7 @@

Syntax

-
var String = HTMLObjectElement.useMap;
+
var String = HTMLObjectElement.useMap;
 HTMLObjectElement.useMap = String;
 
diff --git a/files/en-us/web/api/htmlobjectelement/validationmessage/index.html b/files/en-us/web/api/htmlobjectelement/validationmessage/index.html index 9cb60d51f81dcd9..8cfdf6eb8cfefed 100644 --- a/files/en-us/web/api/htmlobjectelement/validationmessage/index.html +++ b/files/en-us/web/api/htmlobjectelement/validationmessage/index.html @@ -22,7 +22,7 @@

Syntax

var String = HTMLObjectElement.validationMessage;
+ class="brush: js">var String = HTMLObjectElement.validationMessage;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/validity/index.html b/files/en-us/web/api/htmlobjectelement/validity/index.html index e6d858a908bbfd8..657dfb92d1a7500 100644 --- a/files/en-us/web/api/htmlobjectelement/validity/index.html +++ b/files/en-us/web/api/htmlobjectelement/validity/index.html @@ -19,7 +19,7 @@

Syntax

var ValidityState = HTMLObjectElement.validity;
+ class="brush: js">var ValidityState = HTMLObjectElement.validity;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/width/index.html b/files/en-us/web/api/htmlobjectelement/width/index.html index 265b89d97aec70d..d754f9e6c97f9b4 100644 --- a/files/en-us/web/api/htmlobjectelement/width/index.html +++ b/files/en-us/web/api/htmlobjectelement/width/index.html @@ -19,7 +19,7 @@

Syntax

-
var String = HTMLObjectElement.width;
+
var String = HTMLObjectElement.width;
 HTMLObjectElement.width = String;

Value

diff --git a/files/en-us/web/api/htmlobjectelement/willvalidate/index.html b/files/en-us/web/api/htmlobjectelement/willvalidate/index.html index 3accf33f2025a48..efaed1d8f61ef77 100644 --- a/files/en-us/web/api/htmlobjectelement/willvalidate/index.html +++ b/files/en-us/web/api/htmlobjectelement/willvalidate/index.html @@ -20,7 +20,7 @@

Syntax

var Boolean = HTMLObjectElement.willValidate;
+ class="brush: js">var Boolean = HTMLObjectElement.willValidate;

Value

diff --git a/files/en-us/web/api/htmloptionelement/option/index.html b/files/en-us/web/api/htmloptionelement/option/index.html index ee07d5f50f7972b..6360efe4a46dafa 100644 --- a/files/en-us/web/api/htmloptionelement/option/index.html +++ b/files/en-us/web/api/htmloptionelement/option/index.html @@ -19,7 +19,7 @@

Syntax

var optionElementReference = new Option(text, value, defaultSelected, selected);
+ class="brush: js">var optionElementReference = new Option(text, value, defaultSelected, selected);

Parameters

@@ -50,7 +50,7 @@

Examples

Just add new options

-
 /* assuming we have the following HTML
+
 /* assuming we have the following HTML
 <select id='s'>
 
 </select>
@@ -67,7 +67,7 @@ 

Just add new options

Append options with different parameters

-
/* assuming we have the following HTML
+
/* assuming we have the following HTML
 <select id="s">
     <option>First</option>
     <option>Second</option>
diff --git a/files/en-us/web/api/htmlprogresselement/labels/index.html b/files/en-us/web/api/htmlprogresselement/labels/index.html
index c2238f7bbc9b51c..340c998c6aea308 100644
--- a/files/en-us/web/api/htmlprogresselement/labels/index.html
+++ b/files/en-us/web/api/htmlprogresselement/labels/index.html
@@ -16,7 +16,7 @@
 
 

Syntax

-
var labelElements = progress.labels;
+
var labelElements = progress.labels;
 

Return value

diff --git a/files/en-us/web/api/htmlscriptelement/referrerpolicy/index.html b/files/en-us/web/api/htmlscriptelement/referrerpolicy/index.html index f5cc5ea4188c8e1..00378d3d5fe87c5 100644 --- a/files/en-us/web/api/htmlscriptelement/referrerpolicy/index.html +++ b/files/en-us/web/api/htmlscriptelement/referrerpolicy/index.html @@ -18,7 +18,7 @@

Syntax

-
refStr = scriptElem.referrerPolicy;
+
refStr = scriptElem.referrerPolicy;
 scriptElem.referrerPolicy = refStr;

Value

diff --git a/files/en-us/web/api/htmlslotelement/assignedelements/index.html b/files/en-us/web/api/htmlslotelement/assignedelements/index.html index 8adc4f0f832f039..5eab846aad8b309 100644 --- a/files/en-us/web/api/htmlslotelement/assignedelements/index.html +++ b/files/en-us/web/api/htmlslotelement/assignedelements/index.html @@ -22,7 +22,7 @@

Syntax

var assignedElements = HTMLSlotElement.assignedElements(options)
+ class="brush: js">var assignedElements = HTMLSlotElement.assignedElements(options)

Parameters

diff --git a/files/en-us/web/api/htmlslotelement/assignednodes/index.html b/files/en-us/web/api/htmlslotelement/assignednodes/index.html index 3119f5708e47fc8..584cb3ca076c27b 100644 --- a/files/en-us/web/api/htmlslotelement/assignednodes/index.html +++ b/files/en-us/web/api/htmlslotelement/assignednodes/index.html @@ -20,7 +20,7 @@

Syntax

var assignedNodes = HTMLSlotElement.assignedNodes(options)
+ class="brush: js">var assignedNodes = HTMLSlotElement.assignedNodes(options)

Parameters

diff --git a/files/en-us/web/api/htmlslotelement/name/index.html b/files/en-us/web/api/htmlslotelement/name/index.html index 41cc73ff6e14db3..65eb3359fc099c7 100644 --- a/files/en-us/web/api/htmlslotelement/name/index.html +++ b/files/en-us/web/api/htmlslotelement/name/index.html @@ -17,7 +17,7 @@

Syntax

-
var name = htmlSlotElement.name
+
var name = htmlSlotElement.name
 htmlSlotElement.name = name
 
diff --git a/files/en-us/web/api/htmlslotelement/slotchange_event/index.html b/files/en-us/web/api/htmlslotelement/slotchange_event/index.html index dda7e116daa1714..0bbd53b1bfbe3b4 100644 --- a/files/en-us/web/api/htmlslotelement/slotchange_event/index.html +++ b/files/en-us/web/api/htmlslotelement/slotchange_event/index.html @@ -42,7 +42,7 @@

Examples

-
element.setAttribute('slot', slotName);
+
element.setAttribute('slot', slotName);
 // element.assignedSlot = $slot
 element.removeAttribute('slot');
 // element.assignedSlot = null
@@ -50,7 +50,7 @@ 

Examples

The following snippet is taken from our slotchange example (see it live also).

-
let slots = this.shadowRoot.querySelectorAll('slot');
+
let slots = this.shadowRoot.querySelectorAll('slot');
 slots[1].addEventListener('slotchange', function(e) {
   let nodes = slots[1].assignedNodes();
   console.log('Element in Slot "' + slots[1].name + '" changed to "' + nodes[0].outerHTML + '".');
diff --git a/files/en-us/web/api/htmltimeelement/datetime/index.html b/files/en-us/web/api/htmltimeelement/datetime/index.html
index d8d283133efc065..7952331418c7126 100644
--- a/files/en-us/web/api/htmltimeelement/datetime/index.html
+++ b/files/en-us/web/api/htmltimeelement/datetime/index.html
@@ -133,7 +133,7 @@
 
 

Syntax

-
dateTimeString = timeElt.dateTime;
+
dateTimeString = timeElt.dateTime;
 timeElt.dateTime = dateTimeString
 
diff --git a/files/en-us/web/api/idbcursorwithvalue/value/index.html b/files/en-us/web/api/idbcursorwithvalue/value/index.html index f7c6aaa9f2d3f22..67c6bbcb3fd0763 100644 --- a/files/en-us/web/api/idbcursorwithvalue/value/index.html +++ b/files/en-us/web/api/idbcursorwithvalue/value/index.html @@ -24,7 +24,7 @@

Syntax

-
var value = myIDBCursorWithValue.value;
+
var value = myIDBCursorWithValue.value;

Value

diff --git a/files/en-us/web/api/idbopendbrequest/onblocked/index.html b/files/en-us/web/api/idbopendbrequest/onblocked/index.html index 2a6097f522ab4f1..c4df051cb5b763d 100644 --- a/files/en-us/web/api/idbopendbrequest/onblocked/index.html +++ b/files/en-us/web/api/idbopendbrequest/onblocked/index.html @@ -24,7 +24,7 @@

Syntax

IDBOpenDBRequest.onblocked = function(event) { ... };
+ class="brush: js">IDBOpenDBRequest.onblocked = function(event) { ... };

Example

diff --git a/files/en-us/web/api/idbopendbrequest/onupgradeneeded/index.html b/files/en-us/web/api/idbopendbrequest/onupgradeneeded/index.html index b93f134b95118f7..1f1454824cdafab 100644 --- a/files/en-us/web/api/idbopendbrequest/onupgradeneeded/index.html +++ b/files/en-us/web/api/idbopendbrequest/onupgradeneeded/index.html @@ -30,7 +30,7 @@

Syntax

IDBOpenDBRequest.onupgradeneeded = function(event) { ... };
+ class="brush: js">IDBOpenDBRequest.onupgradeneeded = function(event) { ... };

Example

@@ -41,7 +41,7 @@

Example

Notifications app (view example live.)

-
var db;
+
var db;
 
 // Request version 3 of the database.
 var request = window.indexedDB.open("library", 3);
diff --git a/files/en-us/web/api/idbopendbrequest/upgradeneeded_event/index.html b/files/en-us/web/api/idbopendbrequest/upgradeneeded_event/index.html
index 8ceb683af14025b..7d22ad5693156be 100644
--- a/files/en-us/web/api/idbopendbrequest/upgradeneeded_event/index.html
+++ b/files/en-us/web/api/idbopendbrequest/upgradeneeded_event/index.html
@@ -36,7 +36,7 @@ 

Examples

This example opens a database and handles the upgradeneeded event by making any necessary updates to the object store.

-
// Open the database
+
// Open the database
 const dBOpenRequest = window.indexedDB.open('toDoList', 4);
 
 dBOpenRequest.addEventListener('upgradeneeded', event => {
@@ -56,7 +56,7 @@ 

Examples

This is the same example, but uses the onupgradeneeded event handler property.

-
// Open the database
+
// Open the database
 const dBOpenRequest = window.indexedDB.open('toDoList', 4);
 
 dBOpenRequest.onupgradeneeded = event => {
diff --git a/files/en-us/web/api/idbtransaction/abort/index.html b/files/en-us/web/api/idbtransaction/abort/index.html
index df1e22bc26fff31..9760359055b1216 100644
--- a/files/en-us/web/api/idbtransaction/abort/index.html
+++ b/files/en-us/web/api/idbtransaction/abort/index.html
@@ -24,7 +24,7 @@
 
 

Syntax

-
transaction.abort();
+
transaction.abort();

Exceptions

diff --git a/files/en-us/web/api/idbtransaction/db/index.html b/files/en-us/web/api/idbtransaction/db/index.html index 9c8ece589ccd6d2..6b3c0498ab224a7 100644 --- a/files/en-us/web/api/idbtransaction/db/index.html +++ b/files/en-us/web/api/idbtransaction/db/index.html @@ -24,7 +24,7 @@

Syntax

var myDatabase = transaction.db;
+ class="brush: js">var myDatabase = transaction.db;

Value

diff --git a/files/en-us/web/api/idbtransaction/durability/index.html b/files/en-us/web/api/idbtransaction/durability/index.html index 290e5bba58087b2..a60c0df1dbdb386 100644 --- a/files/en-us/web/api/idbtransaction/durability/index.html +++ b/files/en-us/web/api/idbtransaction/durability/index.html @@ -21,7 +21,7 @@

Syntax

var transactionDurability = idbTransaction.durability;
+ class="brush: js">var transactionDurability = idbTransaction.durability;

Value

Any of the following literal {{jsxref('String', 'strings')}}:

diff --git a/files/en-us/web/api/idbtransaction/error/index.html b/files/en-us/web/api/idbtransaction/error/index.html index 3311c516fa04613..088053ae6ce4aa8 100644 --- a/files/en-us/web/api/idbtransaction/error/index.html +++ b/files/en-us/web/api/idbtransaction/error/index.html @@ -24,7 +24,7 @@

Syntax

var myError = transaction.error;
+ class="brush: js">var myError = transaction.error;

Value

diff --git a/files/en-us/web/api/idbtransaction/mode/index.html b/files/en-us/web/api/idbtransaction/mode/index.html index 21131ca8f4152d2..b5750448b4b29f5 100644 --- a/files/en-us/web/api/idbtransaction/mode/index.html +++ b/files/en-us/web/api/idbtransaction/mode/index.html @@ -26,7 +26,7 @@

Syntax

var myCurrentMode = IDBTransaction.mode;
+ class="brush: js">var myCurrentMode = IDBTransaction.mode;

Value

diff --git a/files/en-us/web/api/idbtransaction/objectstore/index.html b/files/en-us/web/api/idbtransaction/objectstore/index.html index 5a0c225bd77026f..a237f3bbab3ed54 100644 --- a/files/en-us/web/api/idbtransaction/objectstore/index.html +++ b/files/en-us/web/api/idbtransaction/objectstore/index.html @@ -26,7 +26,7 @@

Syntax

IDBTransaction.objectStore(name);
+ class="brush: js">IDBTransaction.objectStore(name);

Parameters

diff --git a/files/en-us/web/api/idbtransaction/objectstorenames/index.html b/files/en-us/web/api/idbtransaction/objectstorenames/index.html index 3f70c79c0ec167c..40d8514218eb8ba 100644 --- a/files/en-us/web/api/idbtransaction/objectstorenames/index.html +++ b/files/en-us/web/api/idbtransaction/objectstorenames/index.html @@ -20,7 +20,7 @@

Syntax

var myDatabase = transactionObj.objectStoreNames;
+ class="brush: js">var myDatabase = transactionObj.objectStoreNames;

Returns

diff --git a/files/en-us/web/api/idbtransaction/onabort/index.html b/files/en-us/web/api/idbtransaction/onabort/index.html index d9e5be11c4f3ba1..d71c17c8b26cee7 100644 --- a/files/en-us/web/api/idbtransaction/onabort/index.html +++ b/files/en-us/web/api/idbtransaction/onabort/index.html @@ -24,7 +24,7 @@

Syntax

transaction.onabort = function(event) { ... };
+ class="brush: js">transaction.onabort = function(event) { ... };

Example

diff --git a/files/en-us/web/api/idbtransaction/oncomplete/index.html b/files/en-us/web/api/idbtransaction/oncomplete/index.html index 2c3926b7f57bbb1..9a72f0d3ff84de2 100644 --- a/files/en-us/web/api/idbtransaction/oncomplete/index.html +++ b/files/en-us/web/api/idbtransaction/oncomplete/index.html @@ -44,7 +44,7 @@

Syntax

transaction.oncomplete = function(event) { ... };
+ class="brush: js">transaction.oncomplete = function(event) { ... };

Example

diff --git a/files/en-us/web/api/idbtransaction/onerror/index.html b/files/en-us/web/api/idbtransaction/onerror/index.html index 8b1bb2595e9305f..a1ab10c69982163 100644 --- a/files/en-us/web/api/idbtransaction/onerror/index.html +++ b/files/en-us/web/api/idbtransaction/onerror/index.html @@ -27,7 +27,7 @@

Syntax

transaction.onerror = function(event) { ... };
+ class="brush: js">transaction.onerror = function(event) { ... };

Example

diff --git a/files/en-us/web/api/imagecapture/getphotocapabilities/index.html b/files/en-us/web/api/imagecapture/getphotocapabilities/index.html index 0abcbb4488845bd..cff1e49915b6440 100644 --- a/files/en-us/web/api/imagecapture/getphotocapabilities/index.html +++ b/files/en-us/web/api/imagecapture/getphotocapabilities/index.html @@ -23,7 +23,7 @@

Syntax

const capabilitiesPromise = imageCaptureObj.getPhotoCapabilities()
+ class="brush: js">const capabilitiesPromise = imageCaptureObj.getPhotoCapabilities()

Return diff --git a/files/en-us/web/api/imagecapture/getphotosettings/index.html b/files/en-us/web/api/imagecapture/getphotosettings/index.html index 1d2fa554a231798..b1e93ae46060db0 100644 --- a/files/en-us/web/api/imagecapture/getphotosettings/index.html +++ b/files/en-us/web/api/imagecapture/getphotosettings/index.html @@ -23,7 +23,7 @@

Syntax

const settingsPromise = imageCapture.getPhotoSettings()
+ class="brush: js">const settingsPromise = imageCapture.getPhotoSettings()

Return diff --git a/files/en-us/web/api/imagecapture/grabframe/index.html b/files/en-us/web/api/imagecapture/grabframe/index.html index 010d7a372392032..09af8610b2b6cb0 100644 --- a/files/en-us/web/api/imagecapture/grabframe/index.html +++ b/files/en-us/web/api/imagecapture/grabframe/index.html @@ -22,7 +22,7 @@

Syntax

-
const bitmapPromise = imageCapture.grabFrame()
+
const bitmapPromise = imageCapture.grabFrame()
 

Syntax

const imageCapture = new ImageCapture(videoTrack)
+ class="brush: js">const imageCapture = new ImageCapture(videoTrack)

Parameters

diff --git a/files/en-us/web/api/imagecapture/takephoto/index.html b/files/en-us/web/api/imagecapture/takephoto/index.html index 7065638f96d4cb1..892f3acb5b3b29e 100644 --- a/files/en-us/web/api/imagecapture/takephoto/index.html +++ b/files/en-us/web/api/imagecapture/takephoto/index.html @@ -21,7 +21,7 @@

Syntax

-
+
 const blobPromise = imageCaptureObj.takePhoto()
 const blobPromise = imageCaptureObj.takePhoto(photoSettings)
 
diff --git a/files/en-us/web/api/imagecapture/track/index.html b/files/en-us/web/api/imagecapture/track/index.html index fd23bacea2166e8..7c3d2e05d445121 100644 --- a/files/en-us/web/api/imagecapture/track/index.html +++ b/files/en-us/web/api/imagecapture/track/index.html @@ -22,7 +22,7 @@

Syntax

const mediaStreamTrack = imageCaptureObj.track
+ class="brush: js">const mediaStreamTrack = imageCaptureObj.track

Value

diff --git a/files/en-us/web/api/inputdevicecapabilities/firestouchevents/index.html b/files/en-us/web/api/inputdevicecapabilities/firestouchevents/index.html index 0f3b64ba2cf5d74..27083b6faf43b7a 100644 --- a/files/en-us/web/api/inputdevicecapabilities/firestouchevents/index.html +++ b/files/en-us/web/api/inputdevicecapabilities/firestouchevents/index.html @@ -18,7 +18,7 @@

Syntax

var boolean = InputDeviceCapabilities.firesTouchEvents
+ class="brush: js">var boolean = InputDeviceCapabilities.firesTouchEvents

Returns

diff --git a/files/en-us/web/api/inputdevicecapabilities/inputdevicecapabilities/index.html b/files/en-us/web/api/inputdevicecapabilities/inputdevicecapabilities/index.html index a095ab978110280..9e1e9f3f2b529e2 100644 --- a/files/en-us/web/api/inputdevicecapabilities/inputdevicecapabilities/index.html +++ b/files/en-us/web/api/inputdevicecapabilities/inputdevicecapabilities/index.html @@ -9,7 +9,7 @@

Syntax

var inputDeviceCapabilities = new InputDeviceCapabilities([InputDeviceCapabilitiesInit])
+ class="brush: js">var inputDeviceCapabilities = new InputDeviceCapabilities([InputDeviceCapabilitiesInit])

Returns

diff --git a/files/en-us/web/api/installtrigger/enabled/index.html b/files/en-us/web/api/installtrigger/enabled/index.html index cf8b526787dce0c..d6cf2a53fd35335 100644 --- a/files/en-us/web/api/installtrigger/enabled/index.html +++ b/files/en-us/web/api/installtrigger/enabled/index.html @@ -12,7 +12,7 @@

Method of

object

Syntax

-
Boolean enabled (); 
+
Boolean enabled (); 

Parameters

None

diff --git a/files/en-us/web/api/installtrigger/install/index.html b/files/en-us/web/api/installtrigger/install/index.html index c7ecbc25b1df95e..4f7f9e7e136c685 100644 --- a/files/en-us/web/api/installtrigger/install/index.html +++ b/files/en-us/web/api/installtrigger/install/index.html @@ -10,7 +10,7 @@

Method of

object

Syntax

-
int install(array XPIlist [, function callBackFunc ] )
+
int install(array XPIlist [, function callBackFunc ] )
 

Parameters

diff --git a/files/en-us/web/api/installtrigger/startsoftwareupdate/index.html b/files/en-us/web/api/installtrigger/startsoftwareupdate/index.html index d1cd0f28512b409..68734b55c85f7e8 100644 --- a/files/en-us/web/api/installtrigger/startsoftwareupdate/index.html +++ b/files/en-us/web/api/installtrigger/startsoftwareupdate/index.html @@ -10,7 +10,7 @@

Method of

object

Syntax

-
Boolean startSoftwareUpdate ( String url);
+
Boolean startSoftwareUpdate ( String url);
 

Parameters

diff --git a/files/en-us/web/api/intersection_observer_api/index.html b/files/en-us/web/api/intersection_observer_api/index.html index 3c93a70605c5a71..15e992a4b9eebac 100644 --- a/files/en-us/web/api/intersection_observer_api/index.html +++ b/files/en-us/web/api/intersection_observer_api/index.html @@ -52,7 +52,7 @@

Creating an intersection observer

Create the intersection observer by calling its constructor and passing it a callback function to be run whenever a threshold is crossed in one direction or the other:

-
let options = {
+
let options = {
   root: document.querySelector('#scrollArea'),
   rootMargin: '0px',
   threshold: 1.0
@@ -80,7 +80,7 @@ 

Targeting an element to be observed

Once you have created the observer, you need to give it a target element to watch:

-
let target = document.querySelector('#listItem');
+
let target = document.querySelector('#listItem');
 observer.observe(target);
 
 // the callback we setup for the observer will be executed now for the first time
@@ -89,7 +89,7 @@ 

Targeting an element to be observed

Whenever the target meets a threshold specified for the IntersectionObserver, the callback is invoked. The callback receives a list of {{domxref("IntersectionObserverEntry")}} objects and the observer:

-
let callback = (entries, observer) => {
+
let callback = (entries, observer) => {
   entries.forEach(entry => {
     // Each entry describes an intersection change for one observed
     // target element:
@@ -154,7 +154,7 @@ 

Thresholds

Parameters

diff --git a/files/en-us/web/api/mediakeystatusmap/get/index.html b/files/en-us/web/api/mediakeystatusmap/get/index.html index 011f3eab9ba9950..332134f5afbf7bb 100644 --- a/files/en-us/web/api/mediakeystatusmap/get/index.html +++ b/files/en-us/web/api/mediakeystatusmap/get/index.html @@ -18,7 +18,7 @@

Syntax

var value = mediaKeyStatusMap.get(key);
+ class="brush: js">var value = mediaKeyStatusMap.get(key);

Parameters

diff --git a/files/en-us/web/api/mediakeystatusmap/has/index.html b/files/en-us/web/api/mediakeystatusmap/has/index.html index 51a54dba2f237e1..42351d1e3aa8aee 100644 --- a/files/en-us/web/api/mediakeystatusmap/has/index.html +++ b/files/en-us/web/api/mediakeystatusmap/has/index.html @@ -18,7 +18,7 @@

Syntax

var boolean = mediaKeyStatusMap(key)
+ class="brush: js">var boolean = mediaKeyStatusMap(key)

Parameters

diff --git a/files/en-us/web/api/mediakeystatusmap/keys/index.html b/files/en-us/web/api/mediakeystatusmap/keys/index.html index 723b54e19001ed5..617b6ab1ef795de 100644 --- a/files/en-us/web/api/mediakeystatusmap/keys/index.html +++ b/files/en-us/web/api/mediakeystatusmap/keys/index.html @@ -18,7 +18,7 @@

Syntax

var iterator = mediaKeyStatusMap.keys()
+ class="brush: js">var iterator = mediaKeyStatusMap.keys()

Parameters

diff --git a/files/en-us/web/api/mediakeystatusmap/size/index.html b/files/en-us/web/api/mediakeystatusmap/size/index.html index 113938a3fdd9de6..25c55949c22a5e9 100644 --- a/files/en-us/web/api/mediakeystatusmap/size/index.html +++ b/files/en-us/web/api/mediakeystatusmap/size/index.html @@ -18,7 +18,7 @@

Syntax

var size = MediaKeyStatusMap.size;
+ class="brush: js">var size = MediaKeyStatusMap.size;

Value

diff --git a/files/en-us/web/api/mediakeystatusmap/values/index.html b/files/en-us/web/api/mediakeystatusmap/values/index.html index 9dd30def5f4a167..e21d1d3e19df957 100644 --- a/files/en-us/web/api/mediakeystatusmap/values/index.html +++ b/files/en-us/web/api/mediakeystatusmap/values/index.html @@ -17,7 +17,7 @@

Syntax

-
var iterator = mediaKeyStatusMap.values()
+
var iterator = mediaKeyStatusMap.values()

Parameters

diff --git a/files/en-us/web/api/mediakeysystemaccess/createmediakeys/index.html b/files/en-us/web/api/mediakeysystemaccess/createmediakeys/index.html index 55b7778a84b8e0d..61c58f624e41d19 100644 --- a/files/en-us/web/api/mediakeysystemaccess/createmediakeys/index.html +++ b/files/en-us/web/api/mediakeysystemaccess/createmediakeys/index.html @@ -21,7 +21,7 @@

Syntax

var mediaKeys = await mediaKeySystemAccess.createMediaKeys();
+ class="brush: js">var mediaKeys = await mediaKeySystemAccess.createMediaKeys();

Specifications

diff --git a/files/en-us/web/api/mediakeysystemaccess/getconfiguration/index.html b/files/en-us/web/api/mediakeysystemaccess/getconfiguration/index.html index b4aca8eefef49df..a01ba3ea023bdcc 100644 --- a/files/en-us/web/api/mediakeysystemaccess/getconfiguration/index.html +++ b/files/en-us/web/api/mediakeysystemaccess/getconfiguration/index.html @@ -22,7 +22,7 @@

Syntax

var mediaKeySystemConfiguration = mediaKeySystemAccess.getConfiguration();
+ class="brush: js">var mediaKeySystemConfiguration = mediaKeySystemAccess.getConfiguration();

Specifications

diff --git a/files/en-us/web/api/mediakeysystemaccess/keysystem/index.html b/files/en-us/web/api/mediakeysystemaccess/keysystem/index.html index 31a304a2d4a31bb..8989439f082cb22 100644 --- a/files/en-us/web/api/mediakeysystemaccess/keysystem/index.html +++ b/files/en-us/web/api/mediakeysystemaccess/keysystem/index.html @@ -19,7 +19,7 @@

Syntax

var keySystem = mediaKeySystemAccess.keySystem;
+ class="brush: js">var keySystem = mediaKeySystemAccess.keySystem;

Specifications

diff --git a/files/en-us/web/api/mediametadata/album/index.html b/files/en-us/web/api/mediametadata/album/index.html index 907b156ad650438..e7d779ed881fdba 100644 --- a/files/en-us/web/api/mediametadata/album/index.html +++ b/files/en-us/web/api/mediametadata/album/index.html @@ -15,7 +15,7 @@

Syntax

-
var album = mediaMetaData.album
+
var album = mediaMetaData.album
 mediaMetaData.album = album

Value

@@ -28,7 +28,7 @@

Examples

for the media session.

if ('mediaSession' in navigator) {
+  class="brush: jsline-numbers language-js">if ('mediaSession' in navigator) {
   navigator.mediaSession.metadata = new MediaMetadata({
     title: 'Unforgettable',
     artist: 'Nat King Cole',
diff --git a/files/en-us/web/api/mediametadata/artist/index.html b/files/en-us/web/api/mediametadata/artist/index.html
index 4e52b2e25b0b674..be6079439579f57 100644
--- a/files/en-us/web/api/mediametadata/artist/index.html
+++ b/files/en-us/web/api/mediametadata/artist/index.html
@@ -19,7 +19,7 @@
 
 

Syntax

-
var artist = mediaMetadata.artist
+
var artist = mediaMetadata.artist
 mediaMetadata.artist = artist

Value

@@ -32,7 +32,7 @@

Examples

for the media session.

if ('mediaSession' in navigator) {
+  class="brush: jsline-numbers language-js">if ('mediaSession' in navigator) {
   navigator.mediaSession.metadata = new MediaMetadata({
     title: 'Unforgettable',
     artist: 'Nat King Cole',
diff --git a/files/en-us/web/api/mediametadata/artwork/index.html b/files/en-us/web/api/mediametadata/artwork/index.html
index c00618484768777..3d0bce2cadadd2d 100644
--- a/files/en-us/web/api/mediametadata/artwork/index.html
+++ b/files/en-us/web/api/mediametadata/artwork/index.html
@@ -21,7 +21,7 @@
 
 

Syntax

-
var artwork[] = mediaMetadata.artwork
+
var artwork[] = mediaMetadata.artwork
 mediaMetadata.artwork = artwork[]

Value

@@ -34,7 +34,7 @@

Examples

for the media session.

if ('mediaSession' in navigator) {
+  class="brush: jsline-numbers language-js">if ('mediaSession' in navigator) {
   navigator.mediaSession.metadata = new MediaMetadata({
     title: 'Unforgettable',
     artist: 'Nat King Cole',
diff --git a/files/en-us/web/api/mediametadata/index.html b/files/en-us/web/api/mediametadata/index.html
index 6e8457c9d4d6008..71d87078dbf3920 100644
--- a/files/en-us/web/api/mediametadata/index.html
+++ b/files/en-us/web/api/mediametadata/index.html
@@ -39,7 +39,7 @@ 

Examples

The following example checks for browser compatibility and sets the current metadata for the media session.

-
if ('mediaSession' in navigator) {
+
if ('mediaSession' in navigator) {
   navigator.mediaSession.metadata = new MediaMetadata({
     title: 'Unforgettable',
     artist: 'Nat King Cole',
diff --git a/files/en-us/web/api/mediametadata/mediametadata/index.html b/files/en-us/web/api/mediametadata/mediametadata/index.html
index 8f6e43658dc017b..997d69e38ae4841 100644
--- a/files/en-us/web/api/mediametadata/mediametadata/index.html
+++ b/files/en-us/web/api/mediametadata/mediametadata/index.html
@@ -19,7 +19,7 @@
 
 

Syntax

-
var mediaMetadata = new MediaMetadata([metadata])
+
var mediaMetadata = new MediaMetadata([metadata])

Parameters

@@ -42,7 +42,7 @@

Example

The following example creates a new {{domxref("MediaMetadata")}} object using the correct format of metadata.

-
if ('mediaSession' in navigator){
+
if ('mediaSession' in navigator){
   navigator.mediaSession.metadata = new MediaMetadata({
     title: 'Unforgettable',
     artist: 'Nat King Cole',
diff --git a/files/en-us/web/api/mediametadata/title/index.html b/files/en-us/web/api/mediametadata/title/index.html
index 3b80ddc9b263428..6f3c0fdec191b0b 100644
--- a/files/en-us/web/api/mediametadata/title/index.html
+++ b/files/en-us/web/api/mediametadata/title/index.html
@@ -20,7 +20,7 @@
 
 

Syntax

-
var title = mediaMetaData.title
+
var title = mediaMetaData.title
 mediaMetaData.title = title

Value

@@ -33,7 +33,7 @@

Examples

for the media session.

if ('mediaSession' in navigator) {
+  class="brush: jsline-numbers language-js">if ('mediaSession' in navigator) {
   navigator.mediaSession.metadata = new MediaMetadata({
     title: 'Unforgettable',
     artist: 'Nat King Cole',
diff --git a/files/en-us/web/api/mediaquerylist/addlistener/index.html b/files/en-us/web/api/mediaquerylist/addlistener/index.html
index 6af497682503920..aacd90b83f77214 100644
--- a/files/en-us/web/api/mediaquerylist/addlistener/index.html
+++ b/files/en-us/web/api/mediaquerylist/addlistener/index.html
@@ -24,7 +24,7 @@
 
 

Syntax

-
MediaQueryList.addListener(func)
+
MediaQueryList.addListener(func)

Parameters

@@ -40,7 +40,7 @@

Return value

Example

-
var paragraph = document.querySelector('p');
+
var paragraph = document.querySelector('p');
 var mediaQueryList = window.matchMedia('(max-width: 600px)');
 
 function screenTest(e) {
diff --git a/files/en-us/web/api/mediaquerylist/index.html b/files/en-us/web/api/mediaquerylist/index.html
index a8de340d91250a0..9c7600e51a24bee 100644
--- a/files/en-us/web/api/mediaquerylist/index.html
+++ b/files/en-us/web/api/mediaquerylist/index.html
@@ -54,7 +54,7 @@ 

Examples

This simple example creates a MediaQueryList and then sets up a listener to detect when the media query status changes, running a custom function when it does to change the appearance of the page.

-
var para = document.querySelector('p');
+
var para = document.querySelector('p');
 var mql = window.matchMedia('(max-width: 600px)');
 
 function screenTest(e) {
diff --git a/files/en-us/web/api/mediaquerylist/matches/index.html b/files/en-us/web/api/mediaquerylist/matches/index.html
index b7890f05165e917..e0179ec1567dd6b 100644
--- a/files/en-us/web/api/mediaquerylist/matches/index.html
+++ b/files/en-us/web/api/mediaquerylist/matches/index.html
@@ -27,7 +27,7 @@
 

Syntax

var matches = <varm>MediaQueryList.matches;
+ class="brush: js">var matches = <varm>MediaQueryList.matches;

Value

@@ -40,7 +40,7 @@

Examples

orientation media feature:

-
function addMQListener(mq, callback) {
+
function addMQListener(mq, callback) {
   if (mq.addEventListener) {
     mq.addEventListener("change", callback);
   } else {
diff --git a/files/en-us/web/api/mediaquerylist/media/index.html b/files/en-us/web/api/mediaquerylist/media/index.html
index 60866ff390ff540..3e962113ae08aaa 100644
--- a/files/en-us/web/api/mediaquerylist/media/index.html
+++ b/files/en-us/web/api/mediaquerylist/media/index.html
@@ -19,7 +19,7 @@
 

Syntax

var media = MediaQueryList.media;
+ class="brush: js">var media = MediaQueryList.media;

Value

@@ -33,7 +33,7 @@

Examples

JavaScript

-
let mql = window.matchMedia('(max-width: 600px)');
+
let mql = window.matchMedia('(max-width: 600px)');
 
 document.querySelector(".mq-value").innerText = mql.media;
 
@@ -45,14 +45,14 @@

JavaScript

HTML

-
<span class="mq-value"></span>
+
<span class="mq-value"></span>

A simple <span> to receive the output.