file
stringlengths
16
94
text
stringlengths
32
24.4k
vector
list
api/cssmathinvert/index.md
API - CSSMathInvert - Static methods: The interface may also inherit methods from its parent interface, `CSSMathValue`.
[ -0.27248668670654297, 0.9295846223831177, -0.2617951035499573, 0.1562749743461609, -0.14220985770225525, -1.6787408590316772, 0.26323676109313965, 0.31306391954421997, 1.243857979774475, 0.2938334345817566, -0.364636093378067, 0.3704029321670532, 0.9328941702842712, -0.24413591623306274, ...
api/cssmathinvert/index.md
API - CSSMathInvert - Instance methods: The interface may also inherit methods from its parent interface, `CSSMathValue`.
[ -0.1894454061985016, 1.0147141218185425, -0.23077349364757538, -0.19293110072612762, -0.09802131354808807, -1.4669615030288696, 0.6240243315696716, 0.30543234944343567, 0.8664267659187317, 0.15331295132637024, -0.14203909039497375, 0.4973374009132385, 0.8441060781478882, -0.134787157177925...
api/cssmathinvert/index.md
API - CSSMathInvert - Examples: To do
[ -0.42153200507164, 0.885455310344696, -0.366784006357193, 0.06972228735685349, 0.13100509345531464, -0.935456395149231, 0.6581933498382568, 0.5970069169998169, -0.27564504742622375, 0.4723024070262909, 0.3649916648864746, 1.0198001861572266, 0.645659327507019, -0.5902780294418335, 0.1366...
api/cssmathinvert/cssmathinvert/index.md
API - CSSMathInvert: The `CSSMathInvert()` constructor creates a new `CSSMathInvert` object which represents a CSS `calc()` used as `calc(1 / value)`
[ -0.5829978585243225, 0.5669801831245422, -0.564799964427948, -0.13274821639060974, 0.4742778539657593, -1.9349404573440552, 0.1354920119047165, 0.579245388507843, -0.1542702317237854, 0.1681797206401825, 0.3951984643936157, 0.22153034806251526, 0.2822601795196533, 0.05850449204444885, -0...
api/cssmathinvert/cssmathinvert/index.md
API - CSSMathInvert - Syntax: Example: new CSSMathInvert(arg)
[ -0.5060461163520813, 0.3604566752910614, -0.8923961520195007, -0.23498375713825226, -0.12868015468120575, -2.381809711456299, 0.021236415952444077, 0.5032740831375122, 0.7003768086433411, -0.20819517970085144, -0.019298601895570755, 0.6488828063011169, 0.4029005169868469, 0.129215911030769...
api/cssmathinvert/cssmathinvert/index.md
API - CSSMathInvert - Syntax - Parameters: - `arg`: A `CSSNumericValue`.
[ 0.23173454403877258, 0.36758190393447876, -0.3515033721923828, -0.25819656252861023, -0.2807457447052002, -2.6621241569519043, 0.38952934741973877, 0.5914502739906311, 0.18147358298301697, 0.08735693991184235, -0.1865561455488205, 0.35890993475914, 0.7990232110023499, -0.029591834172606468...
api/cssmathinvert/cssmathinvert/index.md
API - CSSMathInvert - Syntax - Exceptions: - `RangeError`: Raised if the arg is 0 or -0.
[ -0.6277173161506653, 0.5548749566078186, -0.7138009071350098, 0.24842968583106995, -0.40089383721351624, -2.4389612674713135, 0.927626371383667, 0.8313630223274231, 0.2811115086078644, -0.07906968146562576, -0.00034099072217941284, 1.0784311294555664, -0.07570304721593857, -0.1231466829776...
api/cssmathinvert/cssmathinvert/index.md
API - CSSMathInvert - Examples: To do
[ -0.42153200507164, 0.885455310344696, -0.366784006357193, 0.06972228735685349, 0.13100509345531464, -0.935456395149231, 0.6581933498382568, 0.5970069169998169, -0.27564504742622375, 0.4723024070262909, 0.3649916648864746, 1.0198001861572266, 0.645659327507019, -0.5902780294418335, 0.1366...
api/svganimatedenumeration/index.md
API - SVGAnimatedEnumeration: The `SVGAnimatedEnumeration` interface describes attribute values which are constants from a particular enumeration and which can be animated. From SVG 2, both `baseVal` and `animVal` reflect the non-animated value of the attribute. The allowed values of its properties depend on the asso...
[ -0.8461539149284363, -0.6386123299598694, 0.19041763246059418, 0.06093013286590576, -0.06022313982248306, -2.235020875930786, 0.7463428974151611, 0.2603622078895569, 0.6131253242492676, 0.38922443985939026, -0.25039511919021606, 0.27302250266075134, 0.44122567772865295, 0.08702519536018372...
api/svganimatedenumeration/index.md
API - SVGAnimatedEnumeration - Instance properties: - `baseVal`: An integer that is the base value of the given attribute before applying any animations. - `animVal` (read only): This is the same as `baseVal` in SVG 2.
[ -0.7482911944389343, -0.08818183094263077, 0.4122830629348755, 0.1627369225025177, -0.026296421885490417, -2.312894582748413, 0.7132925391197205, 0.4360639452934265, -0.2925160527229309, -0.060855619609355927, -0.6456363797187805, 0.4965130686759949, -0.10994254052639008, -0.29772686958312...
api/svganimatedenumeration/index.md
API - SVGAnimatedEnumeration - Instance methods: The `SVGAnimatedEnumeration` interface does not provide any specific methods.
[ -0.048988424241542816, -0.5117919445037842, -0.2697661519050598, -0.28307056427001953, -0.7457658648490906, -1.7327988147735596, 0.5187708139419556, 0.14344021677970886, 1.010325312614441, 0.19030636548995972, -0.25271081924438477, 0.34558171033859253, 0.7436327934265137, 0.306917130947113...
api/svganimatedenumeration/index.md
API - SVGAnimatedEnumeration - Basic usage: Consider this snippet with a `clipPath` element: Its `clipPathUnits` is associated with a `SVGAnimatedEnumeration` object. Example: <svg viewBox="0 0 100 100" width="200" height="200"> <clipPath id="clip1" clipPathUnits="userSpaceOnUse"> <circle cx="50" cy="50" r="35...
[ -1.346011757850647, -0.3847881555557251, -0.2145870327949524, 0.44271671772003174, -0.27038541436195374, -1.6126214265823364, 1.1210500001907349, -0.13984104990959167, -0.1628124713897705, -0.06491601467132568, -0.3130289316177368, 0.45493757724761963, 0.667897641658783, 0.0727702379226684...
api/svganimatedenumeration/animval/index.md
API - SVGAnimatedEnumeration - animVal: The `animVal` read-only property of the `SVGAnimatedEnumeration` interface represents the value of an SVG enumeration. In SVG 2, `animVal` reflects the non-animated value of the attribute: it is the same as `baseVal` .
[ -0.9839450716972351, -0.2098032832145691, 0.6202392578125, 0.12850016355514526, -0.05089109018445015, -2.7146198749542236, 0.6797637939453125, 0.44198477268218994, 0.2059306502342224, 0.16322478652000427, -0.4085328280925751, 0.22189036011695862, 0.09559939801692963, 0.0706467479467392, ...
api/svganimatedenumeration/animval/index.md
API - SVGAnimatedEnumeration - animVal - Value: An integer representing the value of the enumeration. The allowed values depend on the attribute that is reflected. This property cannot be written.
[ -0.808711051940918, -0.7408859133720398, 0.7714771032333374, -0.2508947551250458, 0.18109172582626343, -2.3430655002593994, 0.6453192830085754, -0.033903010189533234, 0.6379674077033997, -0.13400466740131378, 0.06068558245897293, 0.6327497363090515, 0.23186543583869934, 0.0819893628358841,...
api/svganimatedenumeration/animval/index.md
API - SVGAnimatedEnumeration - animVal - Exceptions: - `NoModificationAllowedError` `DOMException`: Thrown if the property is set to any value.
[ -0.376715749502182, -0.9665185809135437, 0.6190244555473328, 0.05258062481880188, -0.07012034952640533, -2.455867290496826, 0.565860390663147, 0.18828701972961426, 0.23008349537849426, 0.07913099229335785, -0.4196321964263916, 0.8077993988990784, -0.015674592927098274, -0.02244642376899719...
api/svganimatedenumeration/animval/index.md
API - SVGAnimatedEnumeration - animVal - Examples - Basic usage: Example: html, body, svg { height: 100%; } Example: <div> <svg viewBox="0 0 100 100" width="200" height="200"> <clipPath id="clip1" clipPathUnits="userSpaceOnUse"> <animate attributeName="clipPathUnits" values="userSpaceO...
[ -1.026946783065796, -0.5097849369049072, 0.15114420652389526, 0.10350248217582703, -0.5269182920455933, -1.6891103982925415, 0.3123801648616791, 0.045949146151542664, -0.5119905471801758, -0.051627010107040405, -0.39086413383483887, 0.3630659580230713, -0.06297663599252701, -0.052719533443...
api/videotracklist/removetrack_event/index.md
API - VideoTrackList - removetrack event: The `removetrack` event is fired when a video track is removed from a `VideoTrackList`.
[ -0.6620768308639526, -0.45208460092544556, -0.09148824214935303, 0.5635063052177429, -0.4161527156829834, -1.3877155780792236, 0.14207005500793457, 0.09321010857820511, -0.38430729508399963, 0.6023465991020203, -0.18507932126522064, -0.1587725281715393, 0.09009198844432831, 0.4285143315792...
api/videotracklist/removetrack_event/index.md
API - VideoTrackList - removetrack event - Syntax: Use the event name in methods like `addEventListener()`, or set an event handler property. Example: addEventListener("removetrack", (event) => { }) onremovetrack = (event) => { }
[ 0.34064769744873047, -0.8721065521240234, -0.3398386836051941, 0.7076690793037415, -0.1744246780872345, -1.2637263536453247, -0.2179563194513321, 1.0631202459335327, -0.3750823736190796, 0.47497978806495667, -0.2713351845741272, -0.4010830819606781, 0.018689386546611786, 0.0386503487825393...
api/videotracklist/removetrack_event/index.md
API - VideoTrackList - removetrack event - Event type: A `TrackEvent`. Inherits from `Event`.
[ -0.0969153568148613, -0.9234777688980103, -0.09457693248987198, 0.1547822505235672, -0.6142477989196777, -0.9623380899429321, -0.3155484199523926, 1.0834234952926636, 0.04776793718338013, 0.20747658610343933, -0.3013054132461548, 0.03463071584701538, 0.4169732928276062, 0.05403805524110794...
api/videotracklist/removetrack_event/index.md
API - VideoTrackList - removetrack event - Examples: Using `addEventListener()`: Example: const videoElement = document.querySelector("video"); videoElement.videoTracks.addEventListener("removetrack", (event) => { console.log(`Video track: ${event.track.label} removed`); }); Using the `onremovetrack` event handl...
[ -0.262069433927536, -0.8618089556694031, -0.4816325008869171, 0.9455829858779907, 0.01114220917224884, -1.5578582286834717, -0.4012478291988373, 0.606654167175293, -0.6392038464546204, 0.30717477202415466, -0.09653603285551071, 0.00036124885082244873, 0.6269490718841553, 0.0494614318013191...
api/videotracklist/addtrack_event/index.md
API - VideoTrackList - addtrack event: The `addtrack` event is fired when a video track is added to a `VideoTrackList`.
[ -0.5476911664009094, -0.7315539121627808, -0.06553476303815842, 0.470295786857605, -0.8007985949516296, -0.5277915596961975, 0.16080349683761597, 0.035350948572158813, -0.23789115250110626, 0.10021805763244629, -0.41671133041381836, -0.3416832685470581, -0.11590665578842163, 0.547173917293...
api/videotracklist/addtrack_event/index.md
API - VideoTrackList - addtrack event - Syntax: Use the event name in methods like `addEventListener()`, or set an event handler property. Example: addEventListener("addtrack", (event) => { }) onaddtrack = (event) => { }
[ 0.42978519201278687, -1.0714884996414185, -0.38239946961402893, 0.7076888084411621, -0.4044093191623688, -1.0170698165893555, 0.012207522988319397, 1.0205618143081665, 0.026395633816719055, 0.15307003259658813, -0.642365574836731, -0.03843739628791809, -0.23607760667800903, 0.2707145512104...
api/videotracklist/addtrack_event/index.md
API - VideoTrackList - addtrack event - Event type: A `TrackEvent`. Inherits from `Event`.
[ 0.20628622174263, -0.9557219743728638, -0.006878441199660301, 0.3154263496398926, -0.970114529132843, -0.5317748188972473, 0.03833605349063873, 0.882967472076416, -0.3383573293685913, 0.25998514890670776, -0.2637766897678375, 0.15528659522533417, 0.2473665177822113, 0.18913854658603668, ...
api/videotracklist/addtrack_event/index.md
API - VideoTrackList - addtrack event - Examples: Using `addEventListener()`: Example: const videoElement = document.querySelector("video"); videoElement.videoTracks.addEventListener("addtrack", (event) => { console.log(`Video track: ${event.track.label} added`); }); Using the `onaddtrack` event handler property...
[ -0.3460930287837982, -0.9943045973777771, -0.7019345164299011, 1.1576837301254272, -0.21052655577659607, -1.1585109233856201, -0.2586829364299774, 0.6307931542396545, -0.6222696304321289, 0.30960196256637573, -0.1382005363702774, 0.1106770783662796, 0.4675453007221222, 0.1801583468914032, ...
api/offlineaudiocontext/complete_event/index.md
API - OfflineAudioContext - complete event: The `complete` event of the `OfflineAudioContext` interface is fired when the rendering of an offline audio context is complete. This event is not cancelable and does not bubble.
[ -0.2851991057395935, -0.07664937525987625, -0.507843017578125, 0.10071101784706116, 0.01094791293144226, -1.5741016864776611, 0.2564997375011444, 0.9388452172279358, 0.3852710425853729, 0.5162133574485779, -0.3536686897277832, -0.5392094254493713, 0.17494861781597137, 0.29404932260513306, ...
api/offlineaudiocontext/complete_event/index.md
API - OfflineAudioContext - complete event - Syntax: Use the event name in methods like `addEventListener()`, or set an event handler property. Example: addEventListener("complete", (event) => { }) oncomplete = (event) => { }
[ 0.7855380177497864, 0.008814152330160141, -0.4129200875759125, 0.7353313565254211, 0.2366512417793274, -0.9294673800468445, 0.22787529230117798, 0.6354040503501892, 0.1938854455947876, 0.5286695957183838, -1.163548469543457, 0.004914000630378723, -0.30436843633651733, -0.2844909429550171, ...
api/offlineaudiocontext/complete_event/index.md
API - OfflineAudioContext - complete event - Event type: An `OfflineAudioCompletionEvent`. Inherits from `Event`.
[ 0.49633365869522095, 0.3671441078186035, -0.320074200630188, 0.31008976697921753, -0.11037032306194305, -1.1118836402893066, -0.005428405478596687, 1.053608775138855, -0.20682504773139954, 0.6561204791069031, -0.13496661186218262, 0.3187083303928375, -0.42631807923316956, -0.25911372900009...
api/offlineaudiocontext/complete_event/index.md
API - OfflineAudioContext - complete event - Examples: When processing is complete, you might want to use the `complete` event handler to prompt the user that the audio can now be played, and enable the play button: Example: const offlineAudioCtx = new OfflineAudioContext(); offlineAudioCtx.addEventListener("comple...
[ 1.120664119720459, -0.40417951345443726, -1.3624022006988525, 1.2743879556655884, 0.2624652087688446, -1.281678557395935, 0.3647271990776062, 1.622097134590149, -0.016968514770269394, 0.2501620352268219, -0.13028299808502197, -0.14655974507331848, 0.2943669855594635, 0.10720862448215485, ...
api/cssmatrixcomponent/index.md
API - CSSMatrixComponent: The `CSSMatrixComponent` interface of the CSS Typed Object Model API represents the `matrix()` and `matrix3d()` values of the individual `transform` property in CSS. It inherits properties and methods from its parent `CSSTransformValue`.
[ 0.7059648633003235, -1.0145694017410278, -0.5512798428535461, 0.4355163872241974, 0.391645222902298, -1.9204052686691284, 0.3391282856464386, 0.6605551838874817, 1.0998128652572632, 0.5920408368110657, -0.23418578505516052, -0.27156370878219604, 1.2316042184829712, 0.3415394723415375, 0....
api/cssmatrixcomponent/index.md
API - CSSMatrixComponent - Constructor: - `CSSMatrixComponent()`: Creates a new `CSSMatrixComponent` object.
[ 0.0753173977136612, -0.05915695056319237, -0.47258564829826355, 0.2980296313762665, -0.03604879975318909, -1.7864019870758057, 0.623386025428772, 0.5672374367713928, -0.4306419789791107, 0.1417759656906128, -0.26165375113487244, -0.19218790531158447, 0.6025924682617188, 0.2662183940410614,...
api/cssmatrixcomponent/index.md
API - CSSMatrixComponent - Instance properties: - `matrix`: A `DOMMatrix` object.
[ 0.22246402502059937, -0.09016944468021393, -0.21055899560451508, 0.15709687769412994, -0.016402654349803925, -2.066322088241577, 1.2401821613311768, 0.7982708215713501, 0.1531095653772354, 1.0292692184448242, -0.49019941687583923, 0.4665426015853882, 0.35920992493629456, -0.463115483522415...
api/cssmatrixcomponent/index.md
API - CSSMatrixComponent - Examples: To do.
[ 0.16781911253929138, 0.37386834621429443, -0.881829023361206, -0.3303506374359131, -0.4254085123538971, -1.6188974380493164, 0.7538673281669617, 1.3026719093322754, 0.07079502940177917, 0.49598023295402527, 0.4499530494213104, -0.09410234540700912, -0.4344739019870758, -0.07894092798233032...
api/cssmatrixcomponent/cssmatrixcomponent/index.md
API - CSSMatrixComponent: The `CSSMatrixComponent()` constructor creates a new `CSSMatrixComponent` object representing the `matrix()` and `matrix3d()` values of the individual `transform` property in CSS.
[ 0.7021240592002869, -0.025186214596033096, -0.7765700817108154, 0.02475849539041519, 0.9547536373138428, -1.251029372215271, 1.059489130973816, 1.3706482648849487, -0.17936068773269653, 0.3495982885360718, 0.27826473116874695, 0.09446090459823608, 0.1199362725019455, -0.008431453257799149,...
api/cssmatrixcomponent/cssmatrixcomponent/index.md
API - CSSMatrixComponent - Syntax: Example: new CSSMatrixComponent(matrix) new CSSMatrixComponent(matrix, options)
[ 0.06374809145927429, -0.6980092525482178, -0.5557568073272705, 0.2630002200603485, -0.037725336849689484, -2.187793254852295, 0.6565158367156982, 0.7437584400177002, 0.4609975218772888, 0.3115270733833313, -0.5315484404563904, -0.23557071387767792, 0.34541839361190796, 0.34206268191337585,...
api/cssmatrixcomponent/cssmatrixcomponent/index.md
API - CSSMatrixComponent - Syntax - Parameters: - `matrix`: A 2d or 3d matrix.
[ -0.14898455142974854, -0.4710896909236908, -0.5256342887878418, 0.08614698052406311, -0.10872001200914383, -1.3354860544204712, 1.0268253087997437, 0.7189230918884277, 0.02097412198781967, 0.7304461002349854, -0.6346531510353088, 0.2004024088382721, 0.4508078694343567, 0.01189228892326355,...
api/cssmatrixcomponent/cssmatrixcomponent/index.md
API - CSSMatrixComponent - Examples: To do
[ 0.3979989290237427, 0.685523271560669, 0.0835530236363411, 0.4796428084373474, 0.02017343044281006, -1.2638318538665771, 1.1825791597366333, 0.4529311954975128, -0.9026111364364624, 0.6399459838867188, -0.01157451793551445, 0.6657276153564453, 0.25263434648513794, -0.25617799162864685, 0...
api/cssmatrixcomponent/matrix/index.md
API - CSSMatrixComponent - matrix: The `matrix` property of the `CSSMatrixComponent` interface gets and sets a 2D or 3D matrix. See the `matrix()` and `matrix3d()` pages for examples.
[ 0.3537674844264984, -0.18940222263336182, -0.7171525359153748, 0.21784955263137817, 0.05078291893005371, -1.6402655839920044, 1.067360520362854, 0.9615204930305481, 0.05120962858200073, 0.4757550060749054, -0.7108126878738403, -0.07782693207263947, 0.4682084321975708, 0.08694314956665039, ...
api/cssmatrixcomponent/matrix/index.md
API - CSSMatrixComponent - matrix - Value: a matrix.
[ 0.8691937923431396, 0.37118855118751526, -1.0003612041473389, 0.10050219297409058, 0.5228362083435059, -1.9605721235275269, 0.9670125842094421, 1.5250152349472046, -0.6862869262695312, 0.4187001883983612, -0.00021942704916000366, 0.37971341609954834, 0.3601588010787964, 0.3875461220741272,...
api/cssmatrixcomponent/matrix/index.md
API - CSSMatrixComponent - matrix - Examples: To do.
[ 0.18300478160381317, 0.21530680358409882, -0.29376304149627686, -0.026704633608460426, 0.02558305114507675, -1.191880702972412, 1.13662850856781, 0.39062193036079407, -0.7406315803527832, 0.6391919255256653, -0.14242583513259888, 0.3782802224159241, -0.021499499678611755, -0.14241924881935...
api/shadowroot/index.md
API - ShadowRoot: The `ShadowRoot` interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document's main DOM tree. You can retrieve a reference to an element's shadow root using its `Element.shadowRoot` property, provided it was created using `Element.attachShadow()` wit...
[ 0.654376208782196, -1.0064992904663086, 0.25612714886665344, 0.1630105972290039, -0.2395525425672531, -2.2653770446777344, 0.5328715443611145, 0.2489910125732422, 0.62092524766922, 0.2503125071525574, -0.6271100044250488, 0.13439272344112396, -0.2890554368495941, 0.26470065116882324, 0.3...
api/shadowroot/index.md
API - ShadowRoot - Instance properties: - `ShadowRoot.activeElement` (read only): Returns the `Element` within the shadow tree that has focus. - `ShadowRoot.adoptedStyleSheets`: Add an array of constructed stylesheets to be used by the shadow DOM subtree. These may be shared with other DOM subtrees that share the same...
[ 0.6167369484901428, -0.11089479178190231, -0.27725133299827576, -0.35215553641319275, -0.17826154828071594, -0.8565621972084045, 0.6532007455825806, 0.2282988429069519, 0.47593021392822266, -0.02453554794192314, -0.34428858757019043, 0.3472454249858856, -0.2787224054336548, 0.2721037268638...
api/shadowroot/index.md
API - ShadowRoot - Instance methods: - `ShadowRoot.getAnimations()`: Returns an array of all `Animation` objects currently in effect, whose target elements are descendants of the shadow tree. - `ShadowRoot.getSelection()` (non-standard): Returns a `Selection` object representing the range of text selected by the user,...
[ -0.11433794349431992, -0.606755793094635, -0.46562427282333374, 0.416164368391037, -0.14698737859725952, -2.143059492111206, 0.9584306478500366, -0.2773447334766388, -0.2488144338130951, 0.20302951335906982, -0.29699528217315674, 0.1768796741962433, 0.1311296671628952, -0.19337747991085052...
api/shadowroot/index.md
API - ShadowRoot - Events: The following events are available to `ShadowRoot` via event bubbling from `HTMLSlotElement`: - `HTMLSlotElement` `slotchange` event: An event fired when the node(s) contained in that slot change.
[ -0.6688759326934814, -0.031636059284210205, 0.2141292691230774, 0.2288072407245636, -0.25240853428840637, -2.219327926635742, 0.6758288145065308, 1.0310828685760498, -0.11680030822753906, 0.06046594679355621, 0.6722086071968079, 0.5806621313095093, -0.5930001735687256, 0.32030901312828064,...
api/shadowroot/index.md
API - ShadowRoot - Examples: The following snippets are taken from our life-cycle-callbacks example (see it live also), which creates an element that displays a square of a size and color specified in the element's attributes. Inside the `<custom-square>` element's class definition we include some life cycle callback...
[ -0.10397487133741379, -0.6645109057426453, -0.3890101909637451, -0.11032619327306747, 0.056952014565467834, -1.0742073059082031, 0.9896384477615356, 0.5666838884353638, -0.45201873779296875, 0.524448812007904, -0.16104622185230255, 0.6044958233833313, -0.3509911596775055, -0.49749535322189...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML: The `setHTML()` method of the `ShadowRoot` interface provides an XSS-safe method to parse and sanitize a string of HTML, which then replaces the existing tree in the Shadow DOM. The method removes any elements and attributes that are considered XSS-unsafe, even if allowed by a passed sanit...
[ -0.375370591878891, -1.1412452459335327, -0.7246097922325134, 0.9036533236503601, 0.05973370373249054, -1.9765362739562988, 1.2295082807540894, 0.6397913694381714, -0.44764605164527893, 0.5332579016685486, -0.2812574803829193, 0.02119697630405426, 0.2971125543117523, -0.042315348982810974,...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Syntax: Example: setHTML(input) setHTML(input, options)
[ -1.0708554983139038, -0.46027520298957825, 0.3146718144416809, 0.42632704973220825, -0.21976538002490997, -1.6312514543533325, 0.5056794285774231, -0.003244267776608467, -0.022526122629642487, -0.44350317120552063, -0.3913748562335968, -0.20757585763931274, 0.2704409658908844, -0.122752770...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Syntax - Parameters: - `input`: A string defining HTML to be sanitized and injected into the shadow root. - `options` (optional): An options object with the following optional parameters: - `sanitizer`: A `Sanitizer` or `SanitizerConfig` object which defines what elements of the input wi...
[ -0.16306261718273163, -0.7569050192832947, -0.5072401762008667, 1.0916461944580078, -0.2868730425834656, -2.103269100189209, 0.7932590842247009, 0.1883484423160553, 0.3918386995792389, 0.24919743835926056, -0.5734425783157349, -0.07200600206851959, 0.6172122955322266, -0.3951490521430969, ...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Syntax - Return value: None (`undefined`).
[ -0.6256730556488037, 0.12675318121910095, 0.16652773320674896, -0.11334620416164398, -0.1507774293422699, -1.610244631767273, 0.7881047129631042, 0.33184295892715454, -0.29086586833000183, -0.39789018034935, -0.21229912340641022, 0.3068510591983795, -0.15752853453159332, 0.4408832788467407...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Syntax - Exceptions: - `TypeError`: This is thrown if `options.sanitizer` is passed a: - `SanitizerConfig` that isn't valid. For example, a configuration that includes both "allowed" and "removed" configuration settings. - string that does not have the value `"default"`. - value that...
[ -0.8533405065536499, -0.5756304264068604, -0.026429716497659683, 0.7308872938156128, -0.5918709635734558, -2.07208514213562, 0.688920259475708, 0.2785594165325165, 0.8923652768135071, -0.2351483255624771, -0.26389598846435547, -0.26575034856796265, 0.32218095660209656, -0.6035036444664001,...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Description: The `setHTML()` method provides an XSS-safe method to parse and sanitize a string of HTML and use it to replace the existing tree in the Shadow DOM. `setHTML()` removes any HTML entities that aren't allowed by the sanitizer configuration, and further removes any XSS-unsafe el...
[ 0.18124817311763763, -0.9008152484893799, -0.46246856451034546, 0.38177746534347534, -0.1576629877090454, -2.0215697288513184, 0.536266028881073, 0.5385324954986572, 0.31314021348953247, 0.35185539722442627, -0.335349440574646, -0.2913476228713989, -0.12365849316120148, -0.647944450378418,...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Examples - Basic usage: This example shows some of the ways you can use `setHTML()` to sanitize and inject a string of HTML. First we will create the `ShadowRoot` we want to target. This could be created programmatically using `Element.attachShadow()` but for this example we'll create the...
[ 0.16698382794857025, -0.9693602919578552, 0.27806174755096436, 0.6458694338798523, 0.4741132855415344, -1.7591545581817627, 0.7015984058380127, 0.16157062351703644, 0.12179149687290192, 0.2515275776386261, -0.36182457208633423, 0.5532968044281006, -0.133194237947464, -0.3712041974067688, ...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Examples - `setHTML()` live example: This example provides a "live" demonstration of the method when called with different sanitizers. The code defines buttons that you can click to sanitize and inject a string of HTML using a default and a custom sanitizer, respectively. The original stri...
[ -0.5500044226646423, -0.6963012218475342, -0.06586867570877075, 0.7826600670814514, 0.07810157537460327, -2.3841888904571533, 0.6435993313789368, 0.0955498069524765, -0.21374613046646118, 0.2792792022228241, -0.25127214193344116, 0.8885029554367065, 0.2710272967815399, -0.1934567093849182,...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Examples - `setHTML()` live example - HTML: The HTML defines two `button` elements for applying different sanitizers, another button to reset the example, and a `div` that contains the declarative shadow root. Example: <button id="buttonDefault" type="button">Default</button> <button id=...
[ -0.32037192583084106, -0.5621872544288635, -0.18714798986911774, 0.5077792406082153, -0.05298370122909546, -1.719260811805725, 0.5606947541236877, 0.6200639009475708, -0.0024717003107070923, 0.15168370306491852, -0.33290401101112366, 0.6787562966346741, -0.21516400575637817, 0.013019725680...
api/shadowroot/sethtml/index.md
API - ShadowRoot - setHTML - Examples - `setHTML()` live example - JavaScript: Example: const logElement = document.querySelector("#log"); function log(text) { logElement.textContent += text; } Example: if ("Sanitizer" in window) { First we define the handler for the reload button. Example: const reload = docu...
[ 0.2872256636619568, -0.48055344820022583, -0.2283943146467209, 0.6283145546913147, 0.7915204763412476, -1.4908891916275024, 0.24921873211860657, 0.5283636450767517, -0.5583257675170898, 0.4932330846786499, -0.7033335566520691, 0.6694701910018921, -0.11248975992202759, -0.011295653879642487...
api/transitionevent/index.md
API - TransitionEvent: The `TransitionEvent` interface represents events providing information related to transitions.
[ -0.009526452980935574, -0.06926955282688141, -0.4105698764324188, 0.1635967642068863, -0.7513041496276855, -1.659058690071106, 0.32972586154937744, 0.5183877348899841, 0.29026249051094055, 0.24464254081249237, 0.15031792223453522, 0.05851686745882034, 0.020088471472263336, 0.81693667173385...
api/transitionevent/index.md
API - TransitionEvent - Constructor: - `TransitionEvent()`: Creates a `TransitionEvent` event with the given parameters.
[ -1.128857135772705, 0.05796382576227188, 0.062105730175971985, 0.546925961971283, -0.2245570570230484, -1.413907527923584, 0.4427952766418457, 0.6886255741119385, -0.32073166966438293, 0.5175780653953552, -0.3244512975215912, 0.6310537457466125, -0.16772401332855225, 0.5765876173973083, ...
api/transitionevent/index.md
API - TransitionEvent - Instance properties: Also inherits properties from its parent `Event`. - `TransitionEvent.animation` (read only): A `CSSTransition` read-only property containing the animation associated with the event. - `TransitionEvent.propertyName` (read only): A string containing the name CSS property ass...
[ 0.1265803575515747, -0.06205723434686661, -0.43075358867645264, 0.656833291053772, 0.21977382898330688, -1.6305317878723145, 0.4474404752254486, 0.8997730612754822, -0.2529720366001129, 0.5011121034622192, 0.23320752382278442, 0.3804803788661957, 0.035229817032814026, 0.5036606788635254, ...
api/transitionevent/index.md
API - TransitionEvent - Types of `TransitionEvent`: - `transitioncancel`: An `Event` fired when a CSS transition has been cancelled. - `transitionend`: An `Event` fired when a CSS transition has finished playing. - `transitionrun`: An `Event` fired when a CSS transition is created (i.e., when it is added to a set of r...
[ -0.16458889842033386, -0.042625874280929565, -0.5579406023025513, 0.5487293601036072, -0.13038673996925354, -1.376861810684204, 0.4530618488788605, 1.0464316606521606, 0.08834467828273773, 0.8170148134231567, 0.1404705047607422, -0.09723636507987976, -0.24174295365810394, 0.54117351770401,...
api/transitionevent/index.md
API - TransitionEvent - Instance methods: Also inherits methods from its parent `Event`.
[ 0.07249633967876434, -0.3071249723434448, -0.11090624332427979, 0.2270279824733734, -0.19736111164093018, -1.1883069276809692, 0.08553851395845413, 1.06307852268219, -0.09989612549543381, 0.14260201156139374, -0.4595721960067749, 0.5277466177940369, -0.31195002794265747, 0.3823761641979217...
api/transitionevent/animation/index.md
API - TransitionEvent - animation: The `animation` read-only property of the `TransitionEvent` interface represents the animation associated with the event.
[ 0.08693569898605347, 0.015611600130796432, 0.28547075390815735, -0.26702606678009033, -0.24583800137043, -1.287414789199829, 0.5308434367179871, 0.5323882699012756, 0.29650944471359253, -0.14246566593647003, -0.18598037958145142, -0.6279624700546265, 0.019727248698472977, 0.617002189159393...
api/transitionevent/animation/index.md
API - TransitionEvent - animation - Value: A `CSSTransition`, or `null`.
[ -0.47479674220085144, -0.4349057078361511, -0.0007123798131942749, -0.18815864622592926, -0.2597663998603821, -1.6537413597106934, 0.5635882616043091, 0.17169730365276337, -0.5770726799964905, -0.08386506885290146, 0.7594391703605652, -0.4853369891643524, 0.6386186480522156, 0.569939196109...
api/document/index.md
API - Document: The `Document` interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. The DOM tree includes elements such as `body` and `table`, among many others. It provides functionality globally to the document, like how to obtain t...
[ 0.6620567440986633, -0.47267892956733704, -0.0359959676861763, -0.17720146477222443, -0.13742101192474365, -1.0359224081039429, 0.3477628827095032, 0.0883379876613617, 0.13302700221538544, -0.01763198897242546, -0.221577987074852, -0.24356131255626678, 0.384094774723053, 0.1109196096658706...
api/document/index.md
API - Document - Constructor: - `Document()`: Creates a new `Document` object.
[ 0.005530730355530977, -0.16658829152584076, -0.14892946183681488, -0.027889475226402283, -0.37701258063316345, -1.0088187456130981, 0.5161862373352051, 0.5901156067848206, -0.8922589421272278, -0.01574002392590046, -0.30742818117141724, 0.14015933871269226, 0.23291242122650146, 0.378592014...
api/document/index.md
API - Document - Instance properties: This interface also inherits from the `Node` and `EventTarget` interfaces. - `Document.activeElement` (read only): Returns the `Element` that currently has focus. - `Document.activeViewTransition` (read only): Returns a `ViewTransition` instance representing the view transition c...
[ 0.8454076051712036, 0.06595388054847717, -0.0706348866224289, -0.036844100803136826, 0.26330381631851196, -0.38574153184890747, 1.3607573509216309, 1.3226170539855957, -0.2709893584251404, -0.014870116487145424, -0.2327742576599121, 1.03129243850708, 0.08338966220617294, 0.7004538178443909...
api/document/index.md
API - Document - Instance properties - Extensions for HTMLDocument: The `Document` interface for HTML documents inherits from the `HTMLDocument` interface or is extended for such documents. - `Document.cookie`: Returns a semicolon-separated list of the cookies for that document or sets a single cookie. - `Document.de...
[ -0.149091437458992, -0.06241212040185928, 0.6743847131729126, 0.45016229152679443, -0.07064443826675415, -0.7819797396659851, 0.7251014113426208, 0.507544755935669, 0.2984801232814789, -0.18422909080982208, -0.633720874786377, 0.05271981656551361, 0.329708456993103, 0.08932949602603912, ...
api/document/index.md
API - Document - Instance properties - Deprecated properties: - `Document.alinkColor` (deprecated): Returns or sets the color of active links in the document body. - `Document.all` (deprecated): Provides access to all elements in the document — it returns an `HTMLAllCollection` rooted at the document node. This is a l...
[ -0.9224668145179749, -0.1896371841430664, 0.17095942795276642, 0.09262818098068237, -0.20886899530887604, -0.8135844469070435, 0.28609195351600647, 0.7383091449737549, 0.44944238662719727, -0.14465098083019257, -0.9512081742286682, 0.6514705419540405, 0.16885367035865784, -0.37566539645195...
api/document/index.md
API - Document - Instance methods: This interface also inherits from the `Node` and `EventTarget` interfaces. - `Document.adoptNode()`: Adopt node from an external document. - `Document.append()`: Inserts a set of `Node` objects or strings after the last child of the document. - `Document.ariaNotify()`: Specifies tha...
[ 0.7744400501251221, 0.0966029167175293, -0.15507419407367706, 0.22268924117088318, 0.5301704406738281, -0.179197296500206, 1.212476134300232, 1.3089784383773804, -0.7937276363372803, -0.012359287589788437, 0.32542040944099426, 0.8938835263252258, 0.06759615242481232, 0.6099052429199219, ...
api/document/index.md
API - Document - Instance methods - Extension for HTML documents: The `Document` interface for HTML documents inherit from the `HTMLDocument` interface or is extended for such documents: - `Document.clear()` (deprecated): This method does nothing. - `Document.close()`: Closes a document stream for writing. - `Documen...
[ 0.07252845168113708, 0.022332224994897842, 0.004656840115785599, 0.44176700711250305, 0.16195443272590637, -1.682358741760254, 0.14202959835529327, 0.5206831693649292, 0.23777762055397034, 0.09845834225416183, -0.6511757969856262, -0.09992378950119019, 0.2711595892906189, -0.16239769756793...
api/document/index.md
API - Document - Static methods: This interface also inherits from the `Node` and `EventTarget` interfaces. - `Document.parseHTML()`: Creates a new `Document` object from a string of HTML in an XSS-safe manner with sanitization. - `Document.parseHTMLUnsafe()`: Creates a new `Document` object from a string of HTML wit...
[ 0.038669195026159286, -0.4875757694244385, 0.16737514734268188, 0.6292168498039246, 0.1571909338235855, -1.0048103332519531, 0.19221778213977814, 0.078335240483284, 0.4323694705963135, 0.46448057889938354, -0.48484528064727783, -0.05925445631146431, 0.9225760698318481, -0.41373327374458313...
api/document/index.md
API - Document - Events: Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface. In addition to the events listed below, many events can bubble from `nodes` contained in the document tree. - `afterscriptexecute` (non-standard) (deprecated): ...
[ 0.5220926403999329, -0.6451877951622009, -0.10182158648967743, 0.24380922317504883, 0.003669038414955139, -1.4840587377548218, 0.2797797620296478, 0.5743703842163086, 0.6941989064216614, 0.08210690319538116, -0.27255696058273315, -0.4251388609409332, -0.3812987804412842, -0.040447793900966...
api/document/index.md
API - Document - Events - Fullscreen events: - `fullscreenchange`: Fired when the `Document` transitions into or out of fullscreen mode. - `fullscreenerror`: Fired if an error occurs while attempting to switch into or out of fullscreen mode.
[ 0.3254600465297699, -0.018227212131023407, -0.719190776348114, -0.21152251958847046, -0.518358588218689, -1.641745686531067, 0.36555352807044983, 0.4517725110054016, 0.6771330833435059, -0.30156025290489197, -0.024258941411972046, -0.12336990237236023, -0.27380481362342834, 0.4693386554718...
api/document/index.md
API - Document - Events - Load & unload events: - `DOMContentLoaded`: Fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. - `readystatechange`: Fired when the `readyState` attribute of a document has changed.
[ 0.3088546097278595, -0.5489457845687866, 0.14773081243038177, 0.007398691028356552, -0.0939788818359375, -0.8265290260314941, 0.03440822660923004, 0.7218024134635925, 0.33948978781700134, 0.19742317497730255, -0.661385715007782, -0.274600088596344, -0.31098470091819763, 0.2299213707447052,...
api/document/index.md
API - Document - Events - Pointer lock events: - `pointerlockchange`: Fired when the pointer is locked/unlocked. - `pointerlockerror`: Fired when locking the pointer failed.
[ 0.8617874383926392, -0.10860460996627808, -0.8587636947631836, -0.10513590276241302, -0.20738841593265533, -1.0856716632843018, 0.2536374628543854, 0.6046000719070435, 0.5511296987533569, -0.03594771772623062, -0.4314541220664978, 0.1043476015329361, -0.15386071801185608, 0.737939417362213...
api/document/index.md
API - Document - Events - Scroll events: - `scroll`: Fired when the document view or an element has been scrolled. - `scrollend`: Fired when the document view or an element has completed scrolling. - `scrollsnapchange` (experimental): Fired on the scroll container at the end of a scrolling operation when a new scroll ...
[ -0.1584203690290451, -0.44182783365249634, -0.2986704409122467, -0.10077264904975891, 0.4119837284088135, -1.3134936094284058, 0.17872750759124756, 1.4286776781082153, -0.07976245880126953, 0.6014134287834167, 0.6641481518745422, 0.27348440885543823, -0.11958865076303482, 0.885346770286560...
api/document/index.md
API - Document - Events - Selection events: - `selectionchange`: Fired when the current text selection on a document is changed.
[ -0.20687124133110046, 0.001425253227353096, 0.3532630503177643, 0.1313348114490509, 0.10782214999198914, -1.7999882698059082, 0.010686706751585007, 0.893169641494751, -0.3866286277770996, 0.6695190072059631, 0.2772979140281677, -0.3852810859680176, -0.27654069662094116, 0.2616335451602936,...
api/document/index.md
API - Document - Events - Bubbled events: Not all events that bubble can reach the `Document` object. Only the following do and can be listened for on the `Document` object: - `abort` - `auxclick` - `beforeinput` - `beforematch` - `beforetoggle` - `blur` - `cancel` - `canplay` - `canplaythrough` - `change` - `click` ...
[ -0.12334530055522919, -0.5616746544837952, -0.2287619709968567, 0.18153299391269684, -0.32350051403045654, -0.561968982219696, -0.10875951498746872, 1.0842052698135376, 0.7474501132965088, -0.0014456585049629211, -0.5186863541603088, -0.05961485207080841, -0.03355983644723892, -0.273214191...
api/document/hidden/index.md
API - Document - hidden: The `Document.hidden` read-only property returns a Boolean value indicating if the page is considered hidden or not. This can be used to check whether the document is in the background or in a minimized window, or is otherwise not visible to the user. The `Document.visibilityState` property p...
[ -0.6817592978477478, 0.31095874309539795, -0.18853771686553955, 0.04052022099494934, 0.06300310790538788, -0.7133029699325562, 1.0977928638458252, 0.5673074722290039, 0.7386729717254639, -0.050004519522190094, -1.0408716201782227, 0.18449494242668152, 0.05792658030986786, -0.06594394147396...
api/document/hidden/index.md
API - Document - hidden - Value: A Boolean value, `true` if the page is hidden, and `false` otherwise.
[ 0.004548052325844765, -0.08673646301031113, -0.4266681373119354, 0.007292978465557098, -0.33743491768836975, -0.4094039797782898, 0.9531903862953186, 0.28227168321609497, 0.4588713049888611, -0.7410660982131958, -0.898801863193512, -0.0136030875146389, 0.555799663066864, -0.178351715207099...
api/document/hidden/index.md
API - Document - hidden - Examples: Example: document.addEventListener("visibilitychange", () => { console.log(document.hidden); // Modify behavior… });
[ 0.07540544122457504, -0.5170698165893555, -0.051697373390197754, 0.008095916360616684, -0.6117755174636841, -0.7478155493736267, 0.11718055605888367, 0.25243738293647766, -0.07504912465810776, -0.12931910157203674, -0.33133405447006226, -0.654263436794281, -0.12918946146965027, -0.05433258...
api/document/queryselector/index.md
API - Document - querySelector: The `Document` method `querySelector()` returns the first `Element` within the document that matches the specified CSS selector, or group of CSS selectors. If no matches are found, `null` is returned. The matching is done using depth-first pre-order traversal of the document's nodes st...
[ -0.08470091223716736, -0.4660075008869171, -0.24739743769168854, 0.1697251945734024, -0.05412543565034866, -0.9908266067504883, 0.3194364309310913, 0.31792017817497253, -0.3861973285675049, 0.4065721333026886, -0.24962618947029114, -0.6548899412155151, 0.4315502643585205, -0.07246135175228...
api/document/queryselector/index.md
API - Document - querySelector - Syntax: Example: querySelector(selectors)
[ -0.7210227251052856, -0.32742276787757874, -0.17250138521194458, -0.14905713498592377, -0.10038989037275314, -1.6334232091903687, -0.39733847975730896, 0.8452862501144409, 0.11937925219535828, -0.38158828020095825, -0.06744677573442459, 0.208960622549057, -0.00933101586997509, -0.553029239...
api/document/queryselector/index.md
API - Document - querySelector - Syntax - Parameters: - `selectors`: A string containing one or more selectors to match. This string must be a valid CSS selector string; if it isn't, a `SyntaxError` exception is thrown. Note that the HTML specification does not require attribute values to be valid CSS identifiers. If ...
[ -0.44517698884010315, -0.8029106259346008, -0.03305072709918022, 0.32894957065582275, 0.5516621470451355, -1.7275446653366089, -0.06195420026779175, -0.028289243578910828, 0.15333996713161469, 0.08970491588115692, -0.10667770355939865, -0.37646716833114624, 0.33245348930358887, -0.38110524...
api/document/queryselector/index.md
API - Document - querySelector - Syntax - Return value: An `Element` object representing the first element in the document that matches the specified set of CSS selectors, or `null` if there are no matches. If you need a list of all elements matching the specified selectors, you should use `querySelectorAll()` instea...
[ -0.21708916127681732, -0.42654430866241455, -0.034362614154815674, 0.686667263507843, 0.17031434178352356, -1.491900086402893, 0.5646769404411316, 0.21106567978858948, -0.6889481544494629, 0.6444563269615173, 0.08705462515354156, 0.0985235869884491, 0.47048282623291016, 0.3627731502056122,...
api/document/queryselector/index.md
API - Document - querySelector - Syntax - Exceptions: - `SyntaxError` `DOMException`: Thrown if the syntax of the specified selectors is invalid.
[ 0.2838025391101837, -0.9087284803390503, 0.14922884106636047, -0.04400813207030296, -0.13365918397903442, -2.20711350440979, -0.5525379776954651, 0.7331058979034424, 0.19457703828811646, 0.04551154002547264, -0.804995059967041, 0.16489513218402863, 0.013121113181114197, -0.0845259875059127...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Finding the first element matching a class: In this example, the first element in the document with the class `myclass` is returned: Example: const el = document.querySelector(".myclass");
[ -0.5650527477264404, -0.6297861933708191, 0.7461704611778259, -0.25762036442756653, -0.008996039628982544, -0.7969143390655518, 0.26544278860092163, 0.6515973210334778, -0.310737669467926, -0.019631151109933853, -0.1868552565574646, -0.41537952423095703, 0.07296926528215408, -0.01836817711...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Complex selectors: Selectors can also be really powerful, as demonstrated in the following example. Here, the first `input` element with the name "login" (`<input name="login"/>`) located inside a `div` whose class is "user-panel main" (`<div class="user-panel main">`) in th...
[ -0.4278910756111145, -0.38352179527282715, -0.31808891892433167, 1.0525195598602295, 0.5855854749679565, -0.9400374293327332, 0.10625623166561127, -0.09595371037721634, -0.3348648250102997, 0.21962863206863403, -0.0365058071911335, 0.30141481757164, 0.2922764718532562, -0.0766700804233551,...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Negation: As all CSS selector strings are valid, you can also negate selectors: Example: const el = document.querySelector( "div.user-panel:not(.main) input[name='login']", ); This will select an input with a parent div with the `user-panel` class but not the `main` cla...
[ -1.1443101167678833, -0.32842862606048584, 0.19605207443237305, 0.696708619594574, 0.3941478729248047, -2.0269598960876465, 0.12194058299064636, 0.14081242680549622, -0.7524811625480652, 0.5753490328788757, 0.7986871004104614, -0.07092055678367615, 0.19339139759540558, -0.4208616614341736,...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Escaping attribute values: This example shows that if an HTML document contains an `id` which is not a valid CSS identifier, then we must escape the attribute value before using it in `querySelector()`.
[ -0.6699119210243225, -0.24305933713912964, -0.2707398533821106, 0.0010050199925899506, -0.04576308652758598, -1.9314653873443604, 0.44556477665901184, 0.03360913693904877, -0.3904520273208618, 0.38560107350349426, -0.33174654841423035, -0.27555519342422485, 0.12648551166057587, -0.24188272...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Escaping attribute values - HTML: In the following code, a `div` element has an `id` of `"this?element"`, which is not a valid CSS identifier, because the `"?"` character is not allowed in CSS identifiers. We also have three buttons, and a `pre` element for logging errors. ...
[ -0.011648946441709995, -0.3497365415096283, -0.11628378182649612, 0.36262425780296326, 0.10730409622192383, -1.5474331378936768, 0.2790837585926056, 0.07058995217084885, -0.03573102131485939, 0.5478925704956055, -0.4159640967845917, -0.028415504842996597, -0.3252362310886383, 0.07005016505...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Escaping attribute values - CSS: Example: div { background-color: blue; margin: 1rem 0; height: 100px; width: 200px; }
[ -1.2663698196411133, -0.4285367429256439, -0.2993325889110565, -0.7227705121040344, -0.16835558414459229, -0.838269054889679, 0.5021812319755554, 0.12717469036579132, -0.21319900453090668, 0.4795987010002136, 0.3109138309955597, 0.29942965507507324, 0.5998397469520569, 0.009638167917728424...
api/document/queryselector/index.md
API - Document - querySelector - Examples - Escaping attribute values - JavaScript: All three buttons, when clicked, try to select the `<div>`, and then set its background color to a random value. - The first button uses the `"this?element"` value directly. - The second button escapes the value using `CSS.escape()`. ...
[ -0.3239724934101105, -0.27366045117378235, 0.06912112981081009, 0.3772195875644684, -0.11556439101696014, -0.6614581942558289, 0.11909419298171997, 0.6606805920600891, -0.2977919280529022, 0.5985928177833557, -1.1979494094848633, 0.482571542263031, 0.3015139698982239, -0.3264882266521454, ...
api/document/activeelement/index.md
API - Document - activeElement: The `activeElement` read-only property of the `Document` interface returns the `Element` within the DOM that is receiving keyboard events such as `keydown` and `keyup`. This is usually analogous to the focused element. Which elements are focusable varies depending on the platform and t...
[ 1.2049363851547241, 0.03756865859031677, -0.5144747495651245, 0.17218567430973053, 0.1707228720188141, -1.311306118965149, 1.1460676193237305, 0.963826596736908, 0.16296924650669098, 0.5864347219467163, -0.26625072956085205, 0.5170782804489136, 0.07969704270362854, 0.5844491720199585, -0...
api/document/activeelement/index.md
API - Document - activeElement - Value: The deepest `Element` which currently has focus. - If the focused element is within a shadow tree within the current document (for example, the focused element is inside an `iframe`, and the invoking `document` contains that iframe), then this will be the root element of that t...
[ 0.6517302393913269, -0.3289310932159424, -0.035062916576862335, 0.10887055099010468, -0.028462015092372894, -1.7474263906478882, 1.443448543548584, 0.19888699054718018, -0.15932735800743103, 0.10830561816692352, -0.2601083815097809, -0.1351216435432434, 0.08187662065029144, 0.7746103405952...
api/document/activeelement/index.md
API - Document - activeElement - Examples - HTML: Example: <p>Select some text from one of the text areas below:</p> <form> <textarea name="ta-example-one" id="ta-example-one" rows="7" cols="40"> This is Text Area One. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tincidunt, lorem a porttitor mole...
[ -0.6179251670837402, -0.06004714220762253, 0.5209024548530579, -0.45852750539779663, 0.49290257692337036, -1.5904637575149536, -0.02307615429162979, 0.22362978756427765, 0.1630980223417282, 0.6053923964500427, 0.12496070563793182, 0.07118599116802216, -0.5056700706481934, -0.06896307319402...
api/document/activeelement/index.md
API - Document - activeElement - Examples - JavaScript: Example: function onMouseUp(e) { const activeTextarea = document.activeElement; const selection = activeTextarea.value.substring( activeTextarea.selectionStart, activeTextarea.selectionEnd, ); const outputElement = document.getElementById("outpu...
[ 0.1444813311100006, -0.4057530462741852, 0.25984734296798706, 0.2867673337459564, 0.32551321387290955, -1.3265800476074219, 0.3455849587917328, 0.5288199782371521, -0.6477497816085815, 0.5164074301719666, -0.4755060076713562, -0.15527252852916718, -0.3799067735671997, -0.37753909826278687,...
api/document/parsehtml_static/index.md
API - Document - parseHTML static: The `parseHTML()` static method of the `Document` object provides an XSS-safe method to parse and sanitize a string of HTML in order to create a new `Document` instance.
[ 0.17173436284065247, -0.6121731996536255, -0.8458353281021118, 0.4837144613265991, 0.3019150197505951, -1.0840363502502441, 0.5539601445198059, 0.898659884929657, -0.7458299398422241, 0.13595932722091675, -0.45551005005836487, 0.21527421474456787, 0.8783747553825378, 0.26357126235961914, ...
api/document/parsehtml_static/index.md
API - Document - parseHTML static - Syntax: Example: Document.parseHTML(input) Document.parseHTML(input, options)
[ -0.4753657877445221, -0.20689859986305237, 0.6307193040847778, 0.27647852897644043, 0.1270597279071808, -1.6566492319107056, 0.32192087173461914, 0.1399804800748825, -0.06840845942497253, 0.10750067234039307, -0.4196922183036804, -0.1719074249267578, 0.4812244772911072, -0.0589080601930618...
api/document/parsehtml_static/index.md
API - Document - parseHTML static - Syntax - Parameters: - `input`: A string defining HTML to be sanitized and injected into the shadow root. - `options` (optional): An options object with the following optional parameters: - `sanitizer`: A `Sanitizer` or `SanitizerConfig` object which defines what elements of the i...
[ -0.3902861177921295, -0.7745882272720337, -0.1581638902425766, 1.071141242980957, 0.1133427619934082, -1.870160460472107, 0.6846364140510559, 0.23415639996528625, 0.5040145516395569, 0.9203423261642456, -0.7969553470611572, -0.19679945707321167, 0.8669138550758362, -0.37311503291130066, ...
api/document/parsehtml_static/index.md
API - Document - parseHTML static - Syntax - Return value: A `Document`.
[ 0.1376732587814331, -0.20128151774406433, -0.19344191253185272, -0.18429148197174072, -0.25482189655303955, -0.7560261487960815, 0.620621383190155, 0.17082348465919495, -0.4404699504375458, -0.12224012613296509, -0.6377978920936584, 0.276981383562088, 0.2609102427959442, 0.2012656033039093...
api/document/parsehtml_static/index.md
API - Document - parseHTML static - Syntax - Exceptions: - `TypeError`: This is thrown if `options.sanitizer` is passed a: - `SanitizerConfig` that isn't valid. For example, a configuration that includes both "allowed" and "removed" configuration settings. - string that does not have the value `"default"`. - val...
[ -0.22042503952980042, -0.5520168542861938, 0.13038590550422668, 0.8367874622344971, -0.18127292394638062, -1.6931521892547607, 0.26089146733283997, 0.2593418061733246, 0.883140504360199, 0.13562017679214478, -0.423861026763916, 0.09307697415351868, 0.5122208595275879, -0.6471961736679077, ...