browser_clear_input
Summary: Browser Clear Input
POST /api/execute/browser_clear_inputClears all existing characters from an input, textarea, or contenteditable node while firing authentic deletion events. Directly assigning an empty string to a DOM node's value property in JavaScript often fails because React, Vue, and Angular bind state to internal value trackers and InputEvent listeners. To guarantee framework synchronization, this operation locates the control via OwlMark token, CSS query, coordinates, or semantic label, focuses the field, selects its full text range, and synthesizes a Backspace keystroke. Consequently, the control empties cleanly while emitting genuine beforeinput, input, and change notifications up the DOM tree. Invoke this before typing whenever you need to overwrite pre-populated form values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| context_id | string | yes | Workspace handle containing the editable control whose text will be erased. |
| selector | string | yes | Editable field identified via OwlMark token, CSS query, XxY coordinates, or semantic description. |
Usage
result = await browser.clear_input(context_id=context_id, selector="#element-id")