Core API

click()

Simulate a click on the target element.

click()

Clicks on the target element using an HTML Event dispatcher.

Use Cases

  • Clicking a submit button: To show how a user would submit a form in an interactive tutorial.
  • Toggling a checkbox or switch: Demonstrating interactive settings and preferences panels.

Example

const cursor = new Cursor();

cursor
  .hover('.submit-btn')
  .click('.submit-btn');

// Bypasses the specified input element to bypass typical React validations
cursor.click('.checkbox-field');

On this page