Skip to content

Function: fill()

ts
function fill(
   ctx: Context, 
   selector: string, 
   value: string, 
options?: FillOptions): Promise<void>;

Defined in: src/keyboard/index.ts:283

Type a value into a form field, replacing existing text.

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringCSS selector.
valuestringText to type into the field.
options?FillOptionsFill behavior: delay, blur, maxTries, retryDelay.

Returns

Promise<void>

Remarks

Fire an event for each character. To keep the existing text, use type.

Example

ts
// Fill in a login username
await fill(ctx, '#username', 'rocketman_42');

Matterway Assistant SDK Documentation