file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
api/element/animationend_event/index.md | API - Element - animationend event - Examples:
This example gets an element that's being animated and listens for the `animationend` event:
Example:
const animated = document.querySelector(".animated");
animated.addEventListener("animationend", () => {
console.log("Animation ended");
});
The same, but using the ... | [
0.6247559785842896,
-0.6241008043289185,
0.006801005452871323,
0.1541079431772232,
-0.3363454341888428,
-1.6525651216506958,
-0.16299115121364594,
0.0687461569905281,
-0.10237690061330795,
-0.04559184983372688,
-0.407655268907547,
0.05833662301301956,
0.14768259227275848,
0.117403551936149... |
api/element/animationend_event/index.md | API - Element - animationend event - Examples - Live example - HTML:
Example:
<div class="animation-example">
<div class="container">
<p class="animation">You chose a cold night to visit our planet.</p>
</div>
<button class="activate" type="button">Activate animation</button>
<div class="event-log"></div>... | [
0.3041776120662689,
-0.6319282054901123,
0.38211220502853394,
0.11302247643470764,
-0.6200125813484192,
-1.1843217611312866,
0.48267871141433716,
-0.039267268031835556,
-0.9412945508956909,
0.0206783264875412,
-0.23567429184913635,
-0.17991532385349274,
-0.276984304189682,
0.13496549427509... |
api/element/animationend_event/index.md | API - Element - animationend event - Examples - Live example - CSS:
Example:
.container {
height: 3rem;
}
.event-log {
width: 25rem;
height: 2rem;
border: 1px solid black;
margin: 0.2rem;
padding: 0.2rem;
}
.animation.active {
animation-duration: 2s;
animation-name: slide-in;
animation-iteration-c... | [
-0.14770494401454926,
-0.7927367091178894,
-0.2561846077442169,
-0.42121708393096924,
-0.08680283278226852,
-0.8431130647659302,
-0.3515380024909973,
0.40059924125671387,
-0.8992387652397156,
0.3066035211086273,
0.3015168607234955,
0.833621084690094,
0.10410548746585846,
0.2415235042572021... |
api/element/animationend_event/index.md | API - Element - animationend event - Examples - Live example - JavaScript:
Example:
const animation = document.querySelector("p.animation");
const animationEventLog = document.querySelector(
".animation-example>.event-log",
);
const applyAnimation = document.querySelector(
".animation-example>button.activate",
);... | [
0.622096061706543,
-0.845816969871521,
0.009541533887386322,
0.4901394248008728,
-0.06628710776567459,
-1.1765856742858887,
0.11229968070983887,
0.622995138168335,
-0.33686089515686035,
0.12126901745796204,
-0.5817256569862366,
-0.18786609172821045,
-0.42759424448013306,
0.0263008177280426... |
api/element/input_event/index.md | API - Element - input event:
The `input` event fires when the `value` of an `input`, `select`, or `textarea` element has been changed as a direct result of a user action (such as typing in a textbox or checking a checkbox).
The event also applies to elements with `contenteditable` enabled, and to any element when `de... | [
0.017921119928359985,
-0.4694884121417999,
0.15356679260730743,
0.3262261748313904,
0.34856200218200684,
-1.634063482284546,
1.0685302019119263,
0.765278697013855,
-0.00024044513702392578,
0.8573739528656006,
0.2427833080291748,
0.21846067905426025,
0.00956115871667862,
-0.2014949023723602... |
api/element/input_event/index.md | API - Element - input event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("input", (event) => { })
oninput = (event) => { } | [
0.6745200157165527,
-0.349810391664505,
-0.3196984827518463,
0.14410197734832764,
0.04394042491912842,
-1.2430131435394287,
0.18496054410934448,
0.5859481692314148,
0.3365948498249054,
-0.11799293756484985,
-0.3908677399158478,
0.4853714108467102,
0.18349990248680115,
-0.43152230978012085,... |
api/element/input_event/index.md | API - Element - input event - Event type:
An `InputEvent`. Inherits from `UIEvent`. | [
-0.2171952873468399,
-0.0070222895592451096,
-0.5174732208251953,
-0.3080265522003174,
-0.5277038812637329,
-0.5852566957473755,
0.17641888558864594,
0.4327815771102905,
-0.19880278408527374,
0.08805328607559204,
0.2520899474620819,
0.43990403413772583,
0.7598756551742554,
0.16287775337696... |
api/element/input_event/index.md | API - Element - input event - Examples:
This example logs the value whenever you change the value of the `input` element. | [
-0.1050315573811531,
-0.3733407258987427,
-0.6757352948188782,
0.27350565791130066,
-0.3903711140155792,
-0.6352031230926514,
0.3333287835121155,
0.6899257302284241,
0.28533700108528137,
-0.5127294659614563,
0.09150176495313644,
-0.06048689782619476,
0.46584391593933105,
0.0326030328869819... |
api/element/input_event/index.md | API - Element - input event - Examples - HTML:
Example:
<input placeholder="Enter some text" name="name" />
<p id="values"></p> | [
-0.7987381219863892,
-0.4972485899925232,
0.1410161703824997,
-0.7998000979423523,
-0.059351131319999695,
-1.3698158264160156,
0.18443213403224945,
-0.4449804127216339,
-0.6049280762672424,
-0.24492666125297546,
-0.289078950881958,
0.21246787905693054,
0.17652027308940887,
-0.1059466600418... |
api/element/input_event/index.md | API - Element - input event - Examples - JavaScript:
Example:
const input = document.querySelector("input");
const log = document.getElementById("values");
input.addEventListener("input", updateValue);
function updateValue(e) {
log.textContent = e.target.value;
} | [
0.14148133993148804,
-0.1252700835466385,
-0.40309396386146545,
0.4241599440574646,
0.3494422137737274,
-1.182979941368103,
0.8553445339202881,
0.3189847767353058,
-0.617870569229126,
0.27340608835220337,
-0.25354185700416565,
0.03798423707485199,
0.11148689687252045,
-0.28639549016952515,... |
api/element/pointerover_event/index.md | API - Element - pointerover event:
The `pointerover` event is fired when a pointing device is moved into an element's hit test boundaries.
`pointerover` events have the same problems as `mouseover`. If the target element has child elements, `pointerout` and `pointerover` events fire as the pointer moves over the boun... | [
1.077138066291809,
-0.584983229637146,
-0.6981462240219116,
-0.5379410982131958,
0.04705232381820679,
-1.0009795427322388,
0.5856198072433472,
1.5434314012527466,
0.2531546652317047,
0.7602989077568054,
0.22881707549095154,
0.8726327419281006,
-0.056992679834365845,
0.7195038199424744,
0... |
api/element/pointerover_event/index.md | API - Element - pointerover event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pointerover", (event) => { })
onpointerover = (event) => { } | [
0.5908142328262329,
-0.5673027038574219,
0.1277369260787964,
-0.4042084217071533,
-0.20014266669750214,
-1.2076674699783325,
0.1354011595249176,
0.8651116490364075,
0.23677587509155273,
0.24428455531597137,
-0.26455485820770264,
0.4606269598007202,
0.009979035705327988,
0.07687455415725708... |
api/element/pointerover_event/index.md | API - Element - pointerover event - Event type:
A `PointerEvent`. Inherits from `Event`. | [
0.7294723391532898,
-0.2982615530490875,
-0.21419525146484375,
-0.574984610080719,
-0.6410717964172363,
-0.9705316424369812,
0.22905206680297852,
0.5046533942222595,
0.4420958161354065,
0.311583936214447,
0.12865792214870453,
0.2956613302230835,
0.004988405853509903,
0.13892896473407745,
... |
api/element/pointerover_event/index.md | API - Element - pointerover event - Examples:
Using `addEventListener()`:
Example:
const para = document.querySelector("p");
para.addEventListener("pointerover", (event) => {
console.log("Pointer moved in");
});
Using the `onpointerover` event handler property:
Example:
const para = document.querySelector("p")... | [
0.4822486340999603,
-0.33987683057785034,
-0.6075546741485596,
0.4410538077354431,
-0.31184282898902893,
-1.038909673690796,
0.30341246724128723,
0.6508930921554565,
0.23491492867469788,
0.41847285628318787,
-0.03344539925456047,
0.5540831685066223,
0.2897660434246063,
0.2708738148212433,
... |
api/element/auxclick_event/index.md | API - Element - auxclick event:
The `auxclick` event is fired at an `Element` when a non-primary pointing device button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.
`auxclick` is fired after the `mousedown` and `mouseup` events have been... | [
0.23655207455158234,
-0.29029592871665955,
-0.8088892102241516,
0.29260239005088806,
-0.12318682670593262,
-1.398287296295166,
0.1682172566652298,
0.9148393869400024,
-0.2701256275177002,
0.5236257314682007,
0.31442761421203613,
0.7635571956634521,
0.12230110168457031,
0.8335278630256653,
... |
api/element/auxclick_event/index.md | API - Element - auxclick event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("auxclick", (event) => { })
onauxclick = (event) => { } | [
0.561559796333313,
-0.21825888752937317,
-0.3394230306148529,
0.05774854123592377,
-0.21766428649425507,
-1.2702100276947021,
0.29013994336128235,
0.0895327553153038,
0.1845884919166565,
0.301780104637146,
-0.30067989230155945,
0.7554582953453064,
-0.011042231693863869,
-0.1625888943672180... |
api/element/auxclick_event/index.md | API - Element - auxclick event - Event type:
A `PointerEvent`. Inherits from `MouseEvent`.
Note: In earlier versions of the specification, the event type for this event was a `MouseEvent`. Check browser compatibility for more information. | [
0.35145553946495056,
-0.5821473598480225,
-0.4418600797653198,
0.11319991946220398,
-0.32865872979164124,
-0.9056158065795898,
0.3402656316757202,
0.7145301103591919,
0.036484405398368835,
0.6998782753944397,
0.37344133853912354,
1.2373136281967163,
0.2783125936985016,
0.17733746767044067,... |
api/element/auxclick_event/index.md | API - Element - auxclick event - Preventing default actions:
For the vast majority of browsers that map middle click to opening a link in a new tab, including Firefox, it is possible to cancel this behavior by calling `preventDefault()` from within an `auxclick` event handler.
When listening for `auxclick` events ori... | [
0.5853099822998047,
-0.3988969326019287,
-0.5077742338180542,
0.640859842300415,
0.45571231842041016,
-0.959685206413269,
0.6022456288337708,
1.1799408197402954,
-0.02600988745689392,
0.7669617533683777,
0.20575642585754395,
0.7634618282318115,
-0.123106949031353,
0.2985497713088989,
-0.... |
api/element/auxclick_event/index.md | API - Element - auxclick event - Examples:
In this example we define functions for two event handlers — `onclick` and `onauxclick`. The former changes the color of the button background, while the latter changes the button foreground (text) color. You also can see the two functions in action by trying the demo out wit... | [
-0.03422510251402855,
-0.2813466489315033,
-0.045652639120817184,
-0.42715924978256226,
-0.04055849835276604,
-0.7500427961349487,
-0.15893802046775818,
0.5966301560401917,
0.27930566668510437,
0.46597516536712646,
-0.0718390941619873,
0.7622678279876709,
0.6472980976104736,
-0.25978299975... |
api/element/auxclick_event/index.md | API - Element - auxclick event - Examples - JavaScript:
Example:
let button = document.querySelector("button");
let html = document.querySelector("html");
function random(number) {
return Math.floor(Math.random() * number);
}
function randomColor() {
return `rgb(${random(255)} ${random(255)} ${random(255)})`;
}... | [
-0.26153308153152466,
-0.009887208230793476,
0.23593690991401672,
0.2389037311077118,
-0.2605280876159668,
-0.9000471234321594,
-0.27585363388061523,
0.5787704586982727,
0.050371184945106506,
0.3875735104084015,
-0.6664233207702637,
0.7299410104751587,
0.2960446774959564,
0.015583567321300... |
api/element/auxclick_event/index.md | API - Element - auxclick event - Examples - HTML:
Example:
<button>Click me!</button>
Example:
html {
height: 100%;
overflow: hidden;
}
body {
height: inherit;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
}
button {
border: 0;
background-color: white;
font-size: 8vw;... | [
-0.47534462809562683,
0.04754869267344475,
-0.1332320272922516,
-0.0936746746301651,
-0.02022937685251236,
-0.9160929322242737,
0.006735395640134811,
0.4970424175262451,
0.3751905858516693,
-0.06114492565393448,
-0.8240600228309631,
0.8602652549743652,
0.1417929232120514,
0.301950693130493... |
api/element/pointerleave_event/index.md | API - Element - pointerleave event:
The `pointerleave` event is fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. Otherwise, `pointerleave` works the same as `mouseleave`, and are ... | [
0.5833414793014526,
-0.5906478762626648,
-0.5577690005302429,
-0.08900570124387741,
0.18715861439704895,
-1.484543800354004,
0.22914117574691772,
1.732124924659729,
-0.0363822877407074,
0.523514449596405,
0.20187143981456757,
0.7067535519599915,
-0.03739559277892113,
0.41804611682891846,
... |
api/element/pointerleave_event/index.md | API - Element - pointerleave event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pointerleave", (event) => { })
onpointerleave = (event) => { } | [
0.8726679682731628,
-0.33902284502983093,
-0.4497687816619873,
-0.23515111207962036,
-0.183694988489151,
-1.4923731088638306,
0.30142098665237427,
0.7471049427986145,
0.5224699974060059,
0.4517982304096222,
-0.24853087961673737,
0.4680899381637573,
-0.1897164285182953,
0.018321171402931213... |
api/element/pointerleave_event/index.md | API - Element - pointerleave event - Event type:
A `PointerEvent`. Inherits from `Event`. | [
0.6626380681991577,
-0.34204035997390747,
-0.17838464677333832,
-0.5068094730377197,
-0.4928119480609894,
-1.2747972011566162,
0.2835524082183838,
0.6689891815185547,
0.27227526903152466,
0.48465266823768616,
0.2861562967300415,
0.4674668312072754,
-0.12576702237129211,
0.0243801549077034,... |
api/element/pointerleave_event/index.md | API - Element - pointerleave event - Examples:
Using `addEventListener()`:
Example:
const para = document.querySelector("p");
para.addEventListener("pointerleave", (event) => {
console.log("Pointer left element");
});
Using the `onpointerleave` event handler property:
Example:
const para = document.querySelect... | [
0.4599730968475342,
-0.45230403542518616,
-0.44928666949272156,
0.42798155546188354,
0.10882186889648438,
-1.2496967315673828,
0.2815746068954468,
0.8589552044868469,
0.10774342715740204,
0.3674832284450531,
-0.09422429651021957,
0.6138773560523987,
0.12781575322151184,
0.22792592644691467... |
api/element/dblclick_event/index.md | API - Element - dblclick event:
The `dblclick` event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time.
`dblclick` fires after two `click` events (and by extension, after two pairs of ... | [
-0.3217630982398987,
-0.10364208370447159,
-0.8688849806785583,
-0.1362120509147644,
-0.45536214113235474,
-1.058506965637207,
0.4422883987426758,
0.2261907458305359,
-0.12178842723369598,
0.5793097615242004,
-0.3194318115711212,
0.4405832290649414,
0.3063049912452698,
0.11736232042312622,... |
api/element/dblclick_event/index.md | API - Element - dblclick event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("dblclick", (event) => { })
ondblclick = (event) => { } | [
0.5491739511489868,
-0.273226261138916,
-0.5874773859977722,
-0.26110410690307617,
-0.27284112572669983,
-1.210123896598816,
0.31088611483573914,
0.0399521067738533,
0.4087190628051758,
0.30942201614379883,
-0.5607385635375977,
0.7782042026519775,
-0.2671073079109192,
0.09644165635108948,
... |
api/element/dblclick_event/index.md | API - Element - dblclick event - Event type:
A `MouseEvent`. Inherits from `UIEvent` and `Event`. | [
0.22463586926460266,
-0.18850161135196686,
-0.5110127925872803,
-0.5987229943275452,
-0.6231822371482849,
-0.7258219122886658,
0.19344200193881989,
-0.17004264891147614,
0.7095872759819031,
-0.016943054273724556,
-0.19650080800056458,
0.5397043824195862,
0.3278995752334595,
0.1043018251657... |
api/element/dblclick_event/index.md | API - Element - dblclick event - Examples:
This example toggles the size of a card when you double click on it. | [
-0.02454209141433239,
-0.07012930512428284,
-0.6614199876785278,
-0.26183974742889404,
-0.7740801572799683,
-0.935311496257782,
0.6963813304901123,
0.06630848348140717,
-0.10267139971256256,
0.10119061172008514,
-0.04274939000606537,
1.367619514465332,
0.08830288797616959,
-0.1027872264385... |
api/element/dblclick_event/index.md | API - Element - dblclick event - Examples - JavaScript:
Example:
const card = document.querySelector("aside");
card.addEventListener("dblclick", (e) => {
card.classList.toggle("large");
}); | [
0.05039137974381447,
-0.31005603075027466,
-0.5001619458198547,
-0.3905281722545624,
-0.17657186090946198,
-0.8370296955108643,
0.8585089445114136,
0.2407223880290985,
-0.209121972322464,
0.3200848698616028,
0.09939754009246826,
0.8243959546089172,
0.4603266716003418,
0.10795514285564423,
... |
api/element/dblclick_event/index.md | API - Element - dblclick event - Examples - HTML:
Example:
<aside>
<h3>My Card</h3>
<p>Double click to resize this object.</p>
</aside> | [
-0.21436819434165955,
0.2189859002828598,
-0.2861218750476837,
-0.739551842212677,
-0.2393532693386078,
-1.49479079246521,
0.8357231616973877,
0.2762554883956909,
0.09116803109645844,
0.23554575443267822,
-0.40590789914131165,
0.995701789855957,
0.26234278082847595,
-0.17139603197574615,
... |
api/element/dblclick_event/index.md | API - Element - dblclick event - Examples - CSS:
Example:
aside {
background: #ffee99;
border-radius: 1em;
display: inline-block;
padding: 1em;
transform: scale(0.9);
transform-origin: 0 0;
transition: transform 0.6s;
user-select: none;
}
.large {
transform: scale(1.3);
} | [
0.37979549169540405,
-0.10513380914926529,
-0.050742149353027344,
-0.5972447991371155,
-0.004972189664840698,
-0.5075238347053528,
0.08004896342754364,
0.6156014800071716,
-0.30191683769226074,
1.1904138326644897,
-0.04941257834434509,
0.6322503089904785,
0.2413206398487091,
0.238587409257... |
api/element/gesturechange_event/index.md | API - Element - gesturechange event:
Non-standard: This feature is not standardized.
The `gesturechange` event is fired when digits move during a touch gesture.
It is a proprietary event specific to WebKit. | [
-0.05361781269311905,
0.19843029975891113,
-0.40018990635871887,
0.005219444632530212,
0.1653372347354889,
-1.7117775678634644,
0.46811771392822266,
1.234813928604126,
-0.3193938136100769,
0.4168049395084381,
0.17140324413776398,
1.0110055208206177,
-0.35975244641304016,
0.5717661380767822... |
api/element/gesturechange_event/index.md | API - Element - gesturechange event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("gesturechange", (event) => { })
ongesturechange = (event) => { } | [
0.40875130891799927,
-0.3734782040119171,
-0.290382981300354,
-0.4054863452911377,
-0.0806722491979599,
-1.317559838294983,
0.19084377586841583,
0.6486850380897522,
-0.12409091740846634,
0.12974274158477783,
0.25747331976890564,
0.377146452665329,
0.03979756683111191,
-0.02710348181426525,... |
api/element/gesturechange_event/index.md | API - Element - gesturechange event - Event type:
A `GestureEvent`. Inherits from `Event`. | [
0.022184763103723526,
0.09006093442440033,
-0.36738321185112,
-0.5969501733779907,
-0.7129809260368347,
-0.9711117744445801,
0.27674600481987,
0.615928590297699,
0.1523253470659256,
0.16609981656074524,
0.22703200578689575,
0.5227982997894287,
-0.1488148272037506,
0.03310525417327881,
0.... |
api/element/pointerout_event/index.md | API - Element - pointerout event:
The `pointerout` event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the `pointerup` event for a device that does not support hover (see `pointerup`); after firing the `pointercancel` event (see `pointercancel`); ... | [
1.1862115859985352,
-0.43615421652793884,
-0.8701170086860657,
-0.3108014762401581,
0.020027846097946167,
-0.7725136280059814,
0.430606871843338,
1.4412174224853516,
-0.23320144414901733,
1.0089267492294312,
0.060888491570949554,
0.820716917514801,
-0.31697970628738403,
0.595961332321167,
... |
api/element/pointerout_event/index.md | API - Element - pointerout event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pointerout", (event) => { })
onpointerout = (event) => { } | [
0.7889910340309143,
-0.5729016065597534,
-0.23563267290592194,
-0.07991482317447662,
-0.1930433213710785,
-1.0473294258117676,
0.2755873501300812,
0.5503907203674316,
0.0859811007976532,
0.42003732919692993,
-0.4536323547363281,
0.6637822985649109,
-0.18915408849716187,
0.1771315485239029,... |
api/element/pointerout_event/index.md | API - Element - pointerout event - Event type:
A `PointerEvent`. Inherits from `Event`. | [
0.5546090006828308,
-0.29962489008903503,
-0.1027728021144867,
-0.2626946270465851,
-0.5138890743255615,
-1.1517773866653442,
0.2418503761291504,
0.7552840709686279,
0.24498113989830017,
0.40197741985321045,
-0.0032400600612163544,
0.34472113847732544,
-0.0030589643865823746,
0.09177438914... |
api/element/pointerout_event/index.md | API - Element - pointerout event - Examples:
Using `addEventListener()`:
Example:
const para = document.querySelector("p");
para.addEventListener("pointerout", (event) => {
console.log("Pointer moved out");
});
Using the `onpointerout` event handler property:
Example:
const para = document.querySelector("p");
... | [
0.2892932593822479,
-0.429699569940567,
-0.6891257762908936,
0.823259174823761,
-0.19302105903625488,
-1.178792119026184,
-0.11912818253040314,
0.7361636757850647,
0.24642989039421082,
0.2556893825531006,
-0.22313569486141205,
0.7256463170051575,
-0.01869313046336174,
0.16636775434017181,
... |
api/element/pointerenter_event/index.md | API - Element - pointerenter event:
The `pointerenter` event fires when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a `pointerdown` event from a device that does not support hover (see `pointerdown`). Otherwise, `pointerenter` works the same... | [
0.9049726724624634,
-0.5885407328605652,
-0.6185895204544067,
0.03728584200143814,
0.02689586579799652,
-1.290205955505371,
0.26115742325782776,
1.545318841934204,
-0.02111179381608963,
0.6467993259429932,
0.16224485635757446,
0.7084073424339294,
-0.1789034903049469,
0.6382849812507629,
... |
api/element/pointerenter_event/index.md | API - Element - pointerenter event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pointerenter", (event) => { })
onpointerenter = (event) => { } | [
0.5531738996505737,
-0.5595741868019104,
-0.36304837465286255,
-0.19293825328350067,
-0.15775731205940247,
-1.1695274114608765,
-0.11975322663784027,
0.5118917226791382,
0.24542593955993652,
0.17747823894023895,
-0.23635424673557281,
0.46251338720321655,
-0.30056697130203247,
0.38726040720... |
api/element/pointerenter_event/index.md | API - Element - pointerenter event - Event type:
A `PointerEvent`. Inherits from `Event`. | [
0.6379396319389343,
-0.30671069025993347,
-0.1284717470407486,
-0.27721351385116577,
-0.5993022918701172,
-1.0138258934020996,
0.24111181497573853,
0.5700355768203735,
0.25055626034736633,
0.33922845125198364,
0.05953016132116318,
0.2566305696964264,
0.04414302855730057,
-0.012890834361314... |
api/element/pointerenter_event/index.md | API - Element - pointerenter event - Examples:
Using `addEventListener()`:
Example:
const para = document.querySelector("p");
para.addEventListener("pointerenter", (event) => {
console.log("Pointer entered element");
});
Using the `onpointerenter` event handler property:
Example:
const para = document.querySel... | [
0.558200478553772,
-0.4248792231082916,
-0.4831233620643616,
0.5022119283676147,
-0.14293916523456573,
-1.2670526504516602,
0.26702308654785156,
0.790382981300354,
0.2763119339942932,
0.31546086072921753,
-0.1823892891407013,
0.6256484389305115,
0.24413275718688965,
0.11072655022144318,
... |
api/element/scroll/index.md | API - Element - scroll:
The `scroll()` method of the `Element` interface scrolls to a particular set of coordinates inside a given element. | [
-0.12141305208206177,
-0.4980458617210388,
-0.5059946775436401,
-0.0956721231341362,
0.1686694622039795,
-1.5942683219909668,
0.43821388483047485,
-0.5192681550979614,
0.14034651219844818,
0.2297639101743698,
-0.02718893066048622,
0.2793530523777008,
0.4114936292171478,
0.726490318775177,
... |
api/element/scroll/index.md | API - Element - scroll - Syntax:
Example:
scroll(xCoord, yCoord)
scroll(options) | [
-0.49022623896598816,
0.1289972960948944,
-0.8583493232727051,
-0.6694839000701904,
-0.6098487973213196,
-0.5440670251846313,
0.8484978675842285,
0.923551619052887,
-0.14001776278018951,
-0.4775313436985016,
0.4103882312774658,
-0.09438234567642212,
-0.28327828645706177,
0.4710705876350403... |
api/element/scroll/index.md | API - Element - scroll - Syntax - Parameters:
- `xCoord`: The pixel along the horizontal axis of the element that you want displayed in the upper left.
- `yCoord`: The pixel along the vertical axis of the element that you want displayed in the upper left.
- `options`: An object containing the following properties:
-... | [
-0.8383906483650208,
-0.9101670384407043,
-0.4441100060939789,
0.2701570987701416,
-0.0638212114572525,
-1.1170551776885986,
0.46247753500938416,
0.20569363236427307,
0.45364218950271606,
0.5036278963088989,
-0.03427441045641899,
-0.026818521320819855,
0.3739631474018097,
0.941614985466003... |
api/element/scroll/index.md | API - Element - scroll - Syntax - Return value:
A `Promise` that fulfills with an object containing the following property:
- `interrupted`: A boolean value indicating whether the scrolling operation was interrupted (`true`) or not (`false`). Such an interruption typically happens when a programmatic scroll is ongoin... | [
-0.6058378219604492,
-0.038890257477760315,
0.012677561491727829,
0.2869475483894348,
0.00784272700548172,
-1.3314164876937866,
0.45572957396507263,
0.49818700551986694,
-0.39214736223220825,
0.18005183339118958,
-0.20728716254234314,
0.2213343381881714,
0.07843571156263351,
0.657811880111... |
api/element/scroll/index.md | API - Element - scroll - Examples - Basic usage:
Example:
// Put the 1000th vertical pixel at the top of the element
element.scroll(0, 1000);
Using `options`:
Example:
element.scroll({
top: 100,
left: 100,
behavior: "smooth",
}); | [
-0.9193841814994812,
-0.246652290225029,
-0.020125463604927063,
0.11717182397842407,
-0.2559303343296051,
-0.8278895616531372,
0.6448125839233398,
0.10936324298381805,
-0.4246795177459717,
-0.016719872131943703,
-0.04718129336833954,
-0.011056840419769287,
0.7103511095046997,
0.31292402744... |
api/element/scroll/index.md | API - Element - scroll - Examples - Responding to the end of the scroll:
Our element methods demo (see source code) demonstrates how the promise return value of `scroll()` can be used to respond to the end of a scrolling operation. This technique is mostly useful in cases where the scrolling occurs smoothly over time ... | [
-0.3443966209888458,
-0.0788559541106224,
-0.2756412625312805,
-0.12117096036672592,
-0.18819010257720947,
-1.4101415872573853,
0.8310489058494568,
0.56791752576828,
-0.13953211903572083,
0.3894701302051544,
0.22188159823417664,
0.17433327436447144,
0.29386216402053833,
0.6634601354598999,... |
api/element/scroll/index.md | API - Element - scroll - Examples - Responding to the end of the scroll - HTML:
Our HTML includes a `section` element containing several paragraphs of content and a `div` element toolbar containing `button` elements that trigger various scrolling operations on the `<section>`.
Example:
<div>
<button class="scroll"... | [
-0.9447653293609619,
-0.2217256873846054,
-0.11057763546705246,
0.7187047004699707,
0.22915148735046387,
-0.9976028800010681,
0.443360298871994,
0.38629767298698425,
-0.06304454803466797,
0.788640558719635,
-0.09038649499416351,
0.11348952353000641,
-0.10873531550168991,
0.6393332481384277... |
api/element/scroll/index.md | API - Element - scroll - Examples - Responding to the end of the scroll - CSS:
We give the `<section>` element a fixed `height` and an `overflow-y` value of `scroll` so that it scrolls vertically, and set its `scroll-behavior` property to `smooth` so that any scroll operations are animated smoothly over time rather th... | [
-0.10190552473068237,
-0.5984696745872498,
-0.2881125807762146,
-0.09682600200176239,
0.5136883854866028,
-1.0976890325546265,
0.49663424491882324,
1.320892333984375,
-0.6056795716285706,
1.0294750928878784,
0.18604034185409546,
-0.29160088300704956,
0.3704546093940735,
0.44345688819885254... |
api/element/scroll/index.md | API - Element - scroll - Examples - Responding to the end of the scroll - JavaScript:
We start by grabbing references to the `<button>` that runs the `scroll()` operation, the toolbar `<div>`, and the scrolling `<section>`:
Example:
const scrollBtn = document.querySelector(".scroll");
const toolbar = document.queryS... | [
-0.36303797364234924,
-0.38712453842163086,
-0.42010095715522766,
0.11484120786190033,
0.3533145785331726,
-0.6203618049621582,
0.30842265486717224,
0.797555148601532,
-0.08615395426750183,
0.7845906615257263,
-0.4979874789714813,
0.09611931443214417,
-0.1368817239999771,
0.514805316925048... |
api/element/scroll/index.md | API - Element - scroll - Examples - Responding to the end of the scroll - Aside on feature detection:
If you run this example in a browser that doesn't support promise-returning scroll operations, the scroll operations are still smooth, but the toolbar doesn't fade out and then fade back in once the operation is finis... | [
-0.02165449783205986,
-0.15612374246120453,
-0.5060422420501709,
0.7675805687904358,
0.4506760835647583,
-1.2858591079711914,
0.15373973548412323,
0.7903743982315063,
0.25011008977890015,
0.6605160236358643,
-0.009791746735572815,
-0.4285014867782593,
0.4897475242614746,
0.3997395038604736... |
api/element/scrollby/index.md | API - Element - scrollBy:
The `scrollBy()` method of the `Element` interface scrolls an element by the given amount. | [
-0.3232187032699585,
-0.013663972727954388,
-0.34773966670036316,
-0.15119187533855438,
-0.2846844792366028,
-1.9679856300354004,
0.7478073239326477,
-0.3410542905330658,
-0.2129414826631546,
0.2520943284034729,
-0.09010352939367294,
0.055983684957027435,
0.42627421021461487,
0.39612108469... |
api/element/scrollby/index.md | API - Element - scrollBy - Syntax:
Example:
scrollBy(xCoord, yCoord)
scrollBy(options) | [
-0.7195267081260681,
0.35083332657814026,
-0.7655309438705444,
-0.3755403757095337,
-0.6608774662017822,
-0.18360602855682373,
0.5307138562202454,
0.5856678485870361,
-0.1984681487083435,
-0.6144609451293945,
0.122713103890419,
-0.20401257276535034,
0.1995198130607605,
0.23514169454574585,... |
api/element/scrollby/index.md | API - Element - scrollBy - Syntax - Parameters:
- `xCoord`: The horizontal pixel value that you want to scroll by.
- `yCoord`: The vertical pixel value that you want to scroll by.
- `options`: An object containing the following properties:
- `top` (optional): Specifies the number of pixels along the Y axis to scroll... | [
-0.27956077456474304,
-0.7326486110687256,
-0.8992890119552612,
0.3601541817188263,
0.2196560800075531,
-0.8928534388542175,
0.9199527502059937,
0.7478638887405396,
-0.14095786213874817,
0.44807004928588867,
0.01666397973895073,
-0.0848391056060791,
0.722393274307251,
0.9742509126663208,
... |
api/element/scrollby/index.md | API - Element - scrollBy - Syntax - Return value:
A `Promise` that fulfills with an object containing the following property:
- `interrupted`: A boolean value indicating whether the scrolling operation was interrupted (`true`) or not (`false`). Such an interruption typically happens when a programmatic scroll is ongo... | [
-0.7786943316459656,
-0.07249437272548676,
-0.025856906548142433,
0.194610133767128,
-0.10145443677902222,
-1.3354673385620117,
0.5516999959945679,
0.5804643034934998,
-0.49541985988616943,
0.28392064571380615,
-0.22090822458267212,
0.26943498849868774,
0.2005380541086197,
0.41902238130569... |
api/element/scrollby/index.md | API - Element - scrollBy - Examples - Basic usage:
Example:
// scroll an element
element.scrollBy(300, 300);
Using `options`:
Example:
element.scrollBy({
top: 100,
left: 100,
behavior: "smooth",
}); | [
-0.7812190651893616,
-0.2672749161720276,
-0.3370998203754425,
0.17501132190227509,
-0.6516989469528198,
-1.0690057277679443,
0.5506280064582825,
0.13932198286056519,
-0.46455487608909607,
-0.043347325176000595,
-0.35490986704826355,
-0.2422706037759781,
0.5411777496337891,
-0.077813297510... |
api/element/scrollby/index.md | API - Element - scrollBy - Examples - Responding to the end of the scroll:
Our element methods demo (see source code) demonstrates how the promise return value of `scrollBy()` can be used to respond to the end of a scrolling operation. This technique is mostly useful in cases where the scrolling occurs smoothly over t... | [
-0.3063981235027313,
-0.2485063672065735,
-0.435660183429718,
0.2980448007583618,
0.08043977618217468,
-1.2685030698776245,
1.0765610933303833,
1.2147172689437866,
-0.3629295229911804,
0.7266534566879272,
0.2248527705669403,
0.5773142576217651,
1.0154036283493042,
0.6259200572967529,
0.1... |
api/element/scrollby/index.md | API - Element - scrollBy - Examples - Responding to the end of the scroll - HTML:
Our HTML includes a `section` element containing several paragraphs of content and a `div` element toolbar containing `button` elements that trigger various scrolling operations on the `<section>`.
Example:
<div>
<button class="scrol... | [
-0.958968997001648,
-0.3049948215484619,
-0.024993371218442917,
0.6786692142486572,
0.060809046030044556,
-0.9217398762702942,
0.20550958812236786,
0.4123290181159973,
-0.06369436532258987,
0.7133849263191223,
-0.14829161763191223,
0.21377083659172058,
0.12952809035778046,
0.47448807954788... |
api/element/scrollby/index.md | API - Element - scrollBy - Examples - Responding to the end of the scroll - CSS:
We give the `<section>` element a fixed `height` and an `overflow-y` value of `scroll` so that it scrolls vertically, and set its `scroll-behavior` property to `smooth` so that any scroll operations are animated smoothly over time rather ... | [
-0.3985424041748047,
-0.946988582611084,
-0.2644771337509155,
0.19669707119464874,
0.389566570520401,
-1.1899051666259766,
0.5439760088920593,
1.009536862373352,
-0.35368990898132324,
1.2698842287063599,
-0.1509910225868225,
-0.2269584685564041,
0.18476293981075287,
0.30347123742103577,
... |
api/element/scrollby/index.md | API - Element - scrollBy - Examples - Responding to the end of the scroll - JavaScript:
We start by grabbing references to the `<button>` that runs the `scrollBy()` operation, the toolbar `<div>`, and the scrolling `<section>`:
Example:
const scrollByBtn = document.querySelector(".scroll-by");
const toolbar = docume... | [
-0.16896788775920868,
-0.38990679383277893,
-0.28094688057899475,
-0.10054028034210205,
0.1642337143421173,
-0.7270795106887817,
0.17723315954208374,
0.8850966095924377,
0.3403714895248413,
0.49699291586875916,
-0.32982322573661804,
0.30356335639953613,
-0.17563851177692413,
0.067718490958... |
api/element/scrollby/index.md | API - Element - scrollBy - Examples - Responding to the end of the scroll - Aside on feature detection:
If you run this example in a browser that doesn't support promise-returning scroll operations, the scroll operations are still smooth, but the toolbar doesn't fade out and then fade back in once the operation is fin... | [
-0.14993011951446533,
-0.11753728985786438,
-0.4067468047142029,
0.7173856496810913,
0.6885398626327515,
-1.2468708753585815,
0.015864793211221695,
0.8007779717445374,
0.222255676984787,
0.5793876647949219,
-0.13213811814785004,
-0.4416528046131134,
0.4075799584388733,
0.19432035088539124,... |
api/element/pointerrawupdate_event/index.md | API - Element - pointerrawupdate event:
Secure context: This feature is available only in secure contexts (HTTPS).
The `pointerrawupdate` event is fired when a pointer changes any properties that don't fire `pointerdown` or `pointerup` events. See `pointermove` for a list of these properties.
The `pointerrawupdate` ... | [
0.8650871515274048,
0.32084301114082336,
-0.38118183612823486,
0.24036136269569397,
0.15742124617099762,
-0.9012973308563232,
0.787571907043457,
1.6314752101898193,
-0.2253989428281784,
0.22719930112361908,
0.049515046179294586,
0.9593483209609985,
-0.6235519647598267,
0.3605227768421173,
... |
api/element/pointerrawupdate_event/index.md | API - Element - pointerrawupdate event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pointerrawupdate", (event) => { })
onpointerrawupdate = (event) => { } | [
0.7161551117897034,
-0.11399257928133011,
-0.3214538097381592,
-0.25676804780960083,
-0.4207265079021454,
-1.5610836744308472,
0.6243124008178711,
0.4983639717102051,
0.2034778594970703,
0.2990795373916626,
-0.4390234351158142,
0.5004470348358154,
-0.6757994890213013,
0.40594467520713806,
... |
api/element/pointerrawupdate_event/index.md | API - Element - pointerrawupdate event - Event type:
A `PointerEvent`. Inherits from `Event`. | [
0.6669674515724182,
-0.01451652217656374,
-0.08396962285041809,
-0.46205416321754456,
-0.777458131313324,
-1.2397518157958984,
0.361037015914917,
0.8058198094367981,
0.034569382667541504,
0.21886029839515686,
-0.03583630919456482,
0.4381357431411743,
-0.3871541917324066,
0.0761516988277435... |
api/element/pointerrawupdate_event/index.md | API - Element - pointerrawupdate event - Example:
Example:
addEventListener("pointerrawupdate", (event) => {
if (event.getCoalescedEvents && event.getCoalescedEvents().length > 1) {
console.log("Coalesced events:", event.getCoalescedEvents().length);
for (let coalescedEvent of event.getCoalescedEvents()) {
... | [
0.41512903571128845,
-0.5357010960578918,
-0.8514980673789978,
-0.48202231526374817,
-0.7368255257606506,
-1.5684819221496582,
0.3084208369255066,
0.5924962759017944,
-0.2972955107688904,
0.44521281123161316,
-0.04743152856826782,
0.371768981218338,
-0.5734825134277344,
0.2289113700389862,... |
api/element/pointerup_event/index.md | API - Element - pointerup event:
The `pointerup` event is fired when a pointer is no longer active. Remember that it is possible to get a `pointercancel` event instead.
This behavior is different from `mouseup` events. When using a physical mouse, `mouseup` events fire whenever any button on a mouse is released. `poi... | [
0.8128710389137268,
-0.5567904710769653,
-0.5606700778007507,
-0.13707999885082245,
-0.10775789618492126,
-1.4370653629302979,
0.3216973841190338,
1.453865885734558,
0.12925024330615997,
0.5960782170295715,
-0.124278724193573,
0.4564943313598633,
-0.10016551613807678,
0.3804568350315094,
... |
api/element/pointerup_event/index.md | API - Element - pointerup event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("pointerup", (event) => { })
onpointerup = (event) => { } | [
0.7756772041320801,
-0.3580067753791809,
-0.3571559190750122,
-0.05812873691320419,
-0.5497713685035706,
-1.584949016571045,
0.4220491647720337,
0.8186529278755188,
-0.01667625829577446,
0.43483564257621765,
-0.2285154163837433,
0.4897260069847107,
-0.41107606887817383,
-0.0951055958867073... |
api/element/pointerup_event/index.md | API - Element - pointerup event - Event type:
A `PointerEvent`. Inherits from `Event`. | [
0.8073091506958008,
-0.36818504333496094,
-0.02439959906041622,
-0.49791470170021057,
-0.7241743803024292,
-0.8957523703575134,
0.14463180303573608,
0.46020177006721497,
0.28988489508628845,
0.3471710979938507,
0.17524196207523346,
0.3769267201423645,
-0.3844035565853119,
-0.01171801984310... |
api/element/pointerup_event/index.md | API - Element - pointerup event - Examples:
Using `addEventListener()`:
Example:
const para = document.querySelector("p");
para.addEventListener("pointerup", (event) => {
console.log("Pointer up");
});
Using the `onpointerup` event handler property:
Example:
const para = document.querySelector("p");
para.onpo... | [
0.5864943265914917,
-0.4938774108886719,
-0.4786483347415924,
0.37810543179512024,
-0.407680481672287,
-1.2214444875717163,
0.48134344816207886,
0.9140546917915344,
-0.12320095300674438,
0.6955978274345398,
-0.061891354620456696,
0.5152731537818909,
-0.15798674523830414,
0.0539097487926483... |
api/element/gestureend_event/index.md | API - Element - gestureend event:
Non-standard: This feature is not standardized.
The `gestureend` event is fired when there are no longer multiple fingers contacting the touch surface, thus ending the gesture.
It is a proprietary event specific to WebKit. | [
-0.12627317011356354,
-0.19771283864974976,
-0.5607222318649292,
0.08338660001754761,
-0.29069772362709045,
-1.7503278255462646,
0.1684868484735489,
0.6626664400100708,
-0.3295268714427948,
0.48996713757514954,
0.057773783802986145,
1.0520159006118774,
-0.18249917030334473,
0.5664002299308... |
api/element/gestureend_event/index.md | API - Element - gestureend event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("gestureend", (event) => { })
ongestureend = (event) => { } | [
-0.11569876223802567,
-0.40723374485969543,
-0.03618645668029785,
-0.8836255073547363,
-0.07711594551801682,
-0.934718132019043,
0.11128167808055878,
0.36019912362098694,
-0.23163031041622162,
0.036508336663246155,
0.029862642288208008,
0.6339017748832703,
0.11735768616199493,
-0.009013958... |
api/element/gestureend_event/index.md | API - Element - gestureend event - Event type:
A `GestureEvent`. Inherits from `Event`. | [
0.02285444736480713,
0.029169436544179916,
-0.2528175711631775,
-0.38884103298187256,
-0.6897544264793396,
-0.8550315499305725,
0.3398825526237488,
0.6495339870452881,
-0.02664370834827423,
0.3027326762676239,
0.0674244835972786,
0.47104978561401367,
0.019838806241750717,
0.053172923624515... |
api/element/mouseup_event/index.md | API - Element - mouseup event:
The `mouseup` event is fired at an `Element` when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is located inside it.
`mouseup` events are the counterpoint to `mousedown` events.
This behavior is different from `pointerup` events. When using ... | [
0.9252236485481262,
-0.582294225692749,
-0.7595385909080505,
-0.005233354866504669,
-0.09426544606685638,
-1.4608951807022095,
0.48090869188308716,
1.3051527738571167,
0.2590384781360626,
0.49224135279655457,
0.18719559907913208,
0.4297889769077301,
-0.06617103517055511,
0.5450491309165955... |
api/element/mouseup_event/index.md | API - Element - mouseup event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("mouseup", (event) => { })
onmouseup = (event) => { } | [
0.6137034296989441,
-0.42724207043647766,
-0.661490261554718,
0.306942343711853,
-0.2797481417655945,
-1.4127888679504395,
0.32511717081069946,
0.28756946325302124,
0.33382606506347656,
-0.11533942818641663,
-0.45079681277275085,
0.24475938081741333,
-0.10129068046808243,
-0.32364445924758... |
api/element/mouseup_event/index.md | API - Element - mouseup event - Event type:
A `MouseEvent`. Inherits from `UIEvent` and `Event`. | [
0.34315359592437744,
-0.47439876198768616,
-0.7992250919342041,
-0.021645229309797287,
-0.6904329061508179,
-0.7711253762245178,
-0.12005701661109924,
0.16297750174999237,
0.45744913816452026,
-0.11983844637870789,
0.16289661824703217,
0.1938011646270752,
0.0961504727602005,
0.177154302597... |
api/element/mouseup_event/index.md | API - Element - mouseup event - Examples:
See `mousemove` event for example code. | [
0.15610229969024658,
-0.0913580134510994,
-0.5937572121620178,
-0.47415095567703247,
-0.6908791661262512,
-1.0809967517852783,
0.2601083219051361,
0.13278859853744507,
0.38496676087379456,
-0.08573061227798462,
0.14466360211372375,
-0.1129043847322464,
-0.26489976048469543,
0.2213751375675... |
api/element/blur_event/index.md | API - Element - blur event:
The `blur` event fires when an element has lost focus. The event does not bubble, but the related `focusout` event that follows does bubble.
An element will lose focus if another element is selected. An element will also lose focus if a style that does not allow focus is applied, such as `... | [
0.23001964390277863,
0.06862162053585052,
0.24541950225830078,
-0.2193029820919037,
0.2766435146331787,
-1.3870115280151367,
0.5271965861320496,
1.5118838548660278,
-0.5886154770851135,
0.4667813777923584,
-0.04062577337026596,
0.44039297103881836,
-0.27757877111434937,
1.1036403179168701,... |
api/element/blur_event/index.md | API - Element - blur event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("blur", (event) => { })
onblur = (event) => { } | [
0.4061921238899231,
-0.04105007275938988,
0.049479275941848755,
-0.35562145709991455,
-0.0935235247015953,
-1.6309871673583984,
0.3486536145210266,
0.5196188688278198,
0.12340442836284637,
0.042209088802337646,
-0.6317613124847412,
0.36236441135406494,
-0.4738443195819855,
0.23143276572227... |
api/element/blur_event/index.md | API - Element - blur event - Event type:
A `FocusEvent`. Inherits from `UIEvent` and `Event`. | [
-0.04004567861557007,
-0.10239644348621368,
-0.21444803476333618,
-0.7268002033233643,
-0.18054194748401642,
-0.9433349967002869,
-0.2317476123571396,
0.07529783248901367,
-0.3651704788208008,
0.2621172070503235,
0.28644901514053345,
0.5464688539505005,
0.027376368641853333,
0.861684024333... |
api/element/blur_event/index.md | API - Element - blur event - Examples - Simple example - HTML:
Example:
<form id="form">
<label>
Some text:
<input type="text" placeholder="text input" />
</label>
<label>
Password:
<input type="password" placeholder="password" />
</label>
</form> | [
-0.1992861032485962,
0.20675300061702728,
0.25389474630355835,
-0.5070948600769043,
0.1476830542087555,
-1.2893632650375366,
0.4975000023841858,
0.36634400486946106,
-0.6239594221115112,
-0.22286587953567505,
-0.263045072555542,
-0.41835299134254456,
-0.24970592558383942,
0.048930473625659... |
api/element/blur_event/index.md | API - Element - blur event - Examples - Simple example - JavaScript:
Example:
const password = document.querySelector('input[type="password"]');
password.addEventListener("focus", (event) => {
event.target.style.background = "pink";
});
password.addEventListener("blur", (event) => {
event.target.style.backgroun... | [
-0.33640965819358826,
-0.11939789354801178,
-0.21691691875457764,
-0.2875484824180603,
-0.11639654636383057,
-0.8977729082107544,
0.44943588972091675,
0.2867576479911804,
-0.30575716495513916,
0.13362735509872437,
-0.612301766872406,
0.05806542932987213,
-0.3693004250526428,
-0.03528111800... |
api/element/blur_event/index.md | API - Element - blur event - Examples - Event delegation:
There are two ways of implementing event delegation for this event: by using the `focusout` event, or by setting the `useCapture` parameter of `addEventListener()` to `true`. | [
0.23363305628299713,
-0.6273488998413086,
-0.23404480516910553,
0.40146076679229736,
-0.2206951528787613,
-0.9093873500823975,
0.5990211367607117,
0.6635697484016418,
0.10326936841011047,
0.68491131067276,
-0.14759127795696259,
0.39308470487594604,
0.20224379003047943,
0.6974880695343018,
... |
api/element/blur_event/index.md | API - Element - blur event - Examples - Event delegation - HTML:
Example:
<form id="form">
<label>
Some text:
<input type="text" placeholder="text input" />
</label>
<label>
Password:
<input type="password" placeholder="password" />
</label>
</form> | [
-0.14138105511665344,
-0.19820784032344818,
0.32894396781921387,
-0.19018317759037018,
-0.1227303296327591,
-1.334011435508728,
0.5713261961936951,
-0.010959615930914879,
-0.5568981170654297,
-0.1216052919626236,
0.09781232476234436,
-0.25279682874679565,
0.0868968740105629,
0.243692696094... |
api/element/blur_event/index.md | API - Element - blur event - Examples - Event delegation - JavaScript:
Example:
const form = document.getElementById("form");
form.addEventListener(
"focus",
(event) => {
event.target.style.background = "pink";
},
true,
);
form.addEventListener(
"blur",
(event) => {
event.target.style.background... | [
-0.37839657068252563,
-0.5969897508621216,
0.3701331317424774,
-0.5596736669540405,
-0.39936256408691406,
-0.9691940546035767,
0.19232632219791412,
0.41770151257514954,
-0.4802471399307251,
0.5172672867774963,
-0.30524733662605286,
0.38746848702430725,
-0.026406457647681236,
0.067932084202... |
api/element/touchcancel_event/index.md | API - Element - touchcancel event:
The `touchcancel` event is fired when one or more touch points have been disrupted in an implementation-specific manner.
Some examples of situations that will trigger a `touchcancel` event:
- A hardware event occurs that cancels the touch activities. This may include, for example, ... | [
0.8662641644477844,
-0.17602203786373138,
-0.7499227523803711,
-0.26393646001815796,
0.5205936431884766,
-0.8267561793327332,
0.4936497211456299,
1.4909871816635132,
-0.6191563606262207,
0.29555511474609375,
0.20675140619277954,
0.7013423442840576,
0.003703635185956955,
0.1290435492992401,... |
api/element/touchcancel_event/index.md | API - Element - touchcancel event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("touchcancel", (event) => { })
ontouchcancel = (event) => { } | [
0.9308343529701233,
-0.15967249870300293,
-0.4628213047981262,
-0.22434385120868683,
0.1069597452878952,
-1.392663598060608,
0.2753526270389557,
0.5144047737121582,
0.04947051405906677,
0.34799903631210327,
-0.47476544976234436,
0.5057595372200012,
0.0678645446896553,
0.12145557999610901,
... |
api/element/touchcancel_event/index.md | API - Element - touchcancel event - Event type:
A `TouchEvent`. Inherits from `Event`. | [
0.5443130731582642,
-0.034099169075489044,
-0.4198109209537506,
-0.8227815628051758,
0.02604968100786209,
-1.4313831329345703,
-0.17539462447166443,
0.2498714029788971,
0.46857237815856934,
0.3603830337524414,
-0.35154038667678833,
0.6586210131645203,
0.1666620522737503,
0.115683913230896,... |
api/element/touchcancel_event/index.md | API - Element - touchcancel event - Examples:
Code samples for those events are available on the dedicated page: Touch events. | [
0.25643569231033325,
0.23396822810173035,
-0.37778961658477783,
-0.7805991768836975,
-0.2764502167701721,
-1.41398024559021,
0.51189124584198,
0.4632892906665802,
-0.3357107937335968,
0.6291310787200928,
0.03705547749996185,
1.1972715854644775,
0.11727689206600189,
0.44348782300949097,
-... |
api/element/contextmenu_event/index.md | API - Element - contextmenu event:
The `contextmenu` event fires when the user attempts to open a context menu. This event is typically triggered by clicking the right mouse button, or by pressing the context menu key.
In the latter case, the context menu is displayed at the bottom left of the focused element, unless... | [
-0.05110090970993042,
-1.1280040740966797,
-0.14725463092327118,
0.308545857667923,
-0.35275107622146606,
-1.3898648023605347,
0.6977951526641846,
0.7557086944580078,
0.6442376375198364,
0.6565077304840088,
-0.10193919390439987,
-0.2944881319999695,
-0.17671599984169006,
0.6088141202926636... |
api/element/contextmenu_event/index.md | API - Element - contextmenu event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("contextmenu", (event) => { })
oncontextmenu = (event) => { } | [
0.5584743618965149,
-0.43236470222473145,
-0.06906567513942719,
-0.047345053404569626,
-0.1534654051065445,
-1.199178695678711,
-0.0016111042350530624,
0.9319248795509338,
0.05931416153907776,
0.03333260864019394,
-0.26508092880249023,
0.23293989896774292,
-0.07438777387142181,
0.130153387... |
api/element/contextmenu_event/index.md | API - Element - contextmenu event - Event type:
A `PointerEvent`. Inherits from `MouseEvent`.
Note: In earlier versions of the specification, the event type for this event was a `MouseEvent`. Check browser compatibility for more information. | [
0.5719075202941895,
-0.7968546748161316,
-0.45383042097091675,
0.027407921850681305,
-0.44250160455703735,
-1.5995913743972778,
0.3867354094982147,
0.5571174621582031,
0.48877769708633423,
0.6291106939315796,
0.36942893266677856,
0.27805015444755554,
0.5122475624084473,
0.03497088700532913... |
api/element/contextmenu_event/index.md | API - Element - contextmenu event - Examples - Canceling the `contextmenu` event:
In this example, the default action of the `contextmenu` event is canceled using `preventDefault()` when the `contextmenu` event is fired at the first paragraph. As a result, the first paragraph will do nothing when right-clicked, while ... | [
0.11390439420938492,
-0.30907678604125977,
-0.13643814623355865,
0.041333891451358795,
0.1898711919784546,
-1.2706342935562134,
0.5668367147445679,
1.9130373001098633,
-0.2382492870092392,
0.4146043062210083,
0.05915810912847519,
0.1858646273612976,
-0.03713296353816986,
0.8050498962402344... |
api/element/contextmenu_event/index.md | API - Element - contextmenu event - Examples - Canceling the `contextmenu` event - HTML:
Example:
<p id="noContextMenu">The context menu has been disabled on this paragraph.</p>
<p>But it has not been disabled on this one.</p> | [
0.3521103262901306,
-0.4194651246070862,
0.4139113426208496,
-0.3914862275123596,
-0.11165644228458405,
-1.8793977499008179,
0.5630796551704407,
0.7309388518333435,
0.3283880949020386,
0.39539608359336853,
-0.5267658233642578,
-0.18272733688354492,
0.030671633780002594,
0.3612016439437866,... |
api/element/contextmenu_event/index.md | API - Element - contextmenu event - Examples - Canceling the `contextmenu` event - JavaScript:
Example:
const noContext = document.getElementById("noContextMenu");
noContext.addEventListener("contextmenu", (e) => {
e.preventDefault();
}); | [
0.1078636571764946,
-0.047997165471315384,
0.07777713984251022,
-0.18472211062908173,
-0.06479937583208084,
-1.127158522605896,
0.5928661823272705,
0.6014866828918457,
-0.2119535505771637,
0.5187633037567139,
-0.4138242304325104,
-0.13126102089881897,
-0.15200355648994446,
0.20365676283836... |
api/element/compositionend_event/index.md | API - Element - compositionend event:
The `compositionend` event is fired when a text composition system such as an `input method editor` completes or cancels the current composition session.
For example, this event could be fired after a user finishes entering a Chinese character using a Pinyin `Input method editor`... | [
0.15347279608249664,
-0.5098605155944824,
-0.6688323616981506,
0.43955403566360474,
0.2235114574432373,
-1.3596100807189941,
0.4085647165775299,
1.1373987197875977,
-0.43812867999076843,
0.500126302242279,
0.025181766599416733,
-0.02229682356119156,
0.6352617144584656,
0.714389979839325,
... |
api/element/compositionend_event/index.md | API - Element - compositionend event - Syntax:
Use the event name in methods like `addEventListener()`, or set an event handler property.
Example:
addEventListener("compositionend", (event) => { })
oncompositionend = (event) => { } | [
0.8367253541946411,
0.11568593978881836,
-0.373421847820282,
0.4086659550666809,
0.12740395963191986,
-1.5715093612670898,
0.46393853425979614,
0.7789533138275146,
0.030177228152751923,
0.31730812788009644,
-0.41528627276420593,
0.4995790719985962,
-0.18269221484661102,
-0.3087892830371856... |
api/element/compositionend_event/index.md | API - Element - compositionend event - Event type:
A `CompositionEvent`. Inherits from `UIEvent` and `Event`. | [
0.37934091687202454,
0.07323352247476578,
-0.5369963645935059,
0.2643186151981354,
-0.1428646743297577,
-1.0721590518951416,
0.3386886417865753,
0.2170521318912506,
-0.7433292269706726,
0.3719526529312134,
0.24918502569198608,
0.32329490780830383,
0.13998784124851227,
0.4030674993991852,
... |
api/element/compositionend_event/index.md | API - Element - compositionend event - Examples:
Example:
const inputElement = document.querySelector('input[type="text"]');
inputElement.addEventListener("compositionend", (event) => {
console.log(`generated characters were: ${event.data}`);
}); | [
0.4383276700973511,
-0.1669328808784485,
-0.10392218828201294,
0.40522196888923645,
0.6374918222427368,
-1.262488603591919,
0.3796066343784332,
0.3777316212654114,
-0.17796754837036133,
0.6287646889686584,
0.1934620440006256,
-0.08541275560855865,
0.3004808723926544,
-0.12257324904203415,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.