Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Knowledge base — JavaScript

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 1003

JavaScript

Generation ticket cancellation pattern

Use a generation ticket to let only the most recently started operation update state, provided it is still current. Older work can finish without overwriting that state.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Generator function declaration and generator method

Both forms define synchronous generator functions. A declaration introduces a name in scope, while a method belongs to an object or class.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Hexadecimal numeric literals

Write base-16 integers with `0x` or `0X`, and add `n` when you need an exact `BigInt` value rather than a potentially rounded `Number`.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

HTMLAnchorElement: link URL and navigation target

`href` specifies the link's address; `target` tells the browser which browsing context to use when following it.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

HTMLAnchorElement.target — where a link navigates

Read or set a link’s `target` attribute, and distinguish its stored value from the browsing context the browser selects when the link is followed.

Advanced · Current web platform; runtime support varies
JavaScript

HTMLCanvasElement: rendering contexts and bitmap dimensions

Choose a rendering context with `getContext()` and size its bitmap with `width` and `height`. Unlike CSS sizing, writing either dimension clears the bitmap and resets drawing state in 2D mode.

Advanced · Current web platform; runtime support varies
JavaScript

HTMLCanvasElement: bitmap width and height

`canvas.width` and `canvas.height` size the bitmap, not the CSS display box. With a 2D context, even assigning the current value clears the drawing and resets the drawing state.

Intermediate · Current web platform; runtime support varies
JavaScript

HTML dragstart, dragover, drop, and dragend events

Separate source and target events so you can set drag data, accept a drop, read the payload, and clean up even when a drag is canceled.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

HTMLElement constructor

`HTMLElement` is the base class for autonomous custom elements. Invoke its constructor through `super()` in a subclass, not directly with `new HTMLElement()`.

Intermediate · Current web platform; runtime support varies
JavaScript

`HTMLElement.draggable` and `tabIndex`: dragging and focus

`draggable` controls whether an element can be a drag source. `tabIndex` influences whether and when Tab navigation reaches it. Setting one property does not replace setting the other.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

HTMLElement.style: transform and height

Set an element’s transform and height from JavaScript, and distinguish inline declarations from the values resolved by the CSS cascade.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

`HTMLElement.style`: transforms and touch gestures

Use `style.transform` to change an element’s visual geometry and `style.touchAction` to control which panning and zooming gestures the browser may handle. Both write inline CSS declarations.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Inline width and height: `style.width` and `style.height`

Use `element.style.width` and `element.style.height` to read, set, and remove inline CSS declarations. Reading a declaration is not the same as measuring the element.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Disabling HTML form controls with `disabled`

Use `disabled` to make an HTML form control unavailable for user interaction and exclude it from validation and form data. The `.disabled` property and `:disabled` selector answer different questions.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

`submit` and `input` events on HTML forms

Use `input` to react to edits and `submit` to handle form submission at the right point in the validation flow.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

iframe contentWindow and the load event

`contentWindow` gives you a reference to the iframe’s window, while `load` tells you that the browser has finished a load attempt. Neither confirms success or grants DOM access.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Natural image dimensions and the `complete` state

Read an image’s natural size in CSS pixels and distinguish request completion from successful loading or decoding.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

`value` and `disabled` on input and textarea elements

Read and update a form control’s value independently of whether the user can interact with it. Distinguish an element’s own `disabled` attribute from its effective disabled state and see which values make it into form data.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies