Skip to main content
Version: v2

@friendlycaptcha/sdk > FriendlyCaptchaSDK > attach

FriendlyCaptchaSDK.attach() method

Attaches a widget to given element or elements if they are not attached to yet.

You can pass one or more HTML elements to attach to, or undefined. If undefined is passed, the HTML page is scanned for unattached widget elements (= elements with the frc-captcha class).

Returns handles to the newly-attached elements.

Signature:

attach(elements?: HTMLElement | HTMLElement[] | NodeListOf<Element>): WidgetHandle[];

Parameters

ParameterTypeDescription
elementsHTMLElement | HTMLElement[] | NodeListOf<Element>(Optional)

Returns:

WidgetHandle[]