Skip to content

element.mount()

Method@tryyoursize/sdk

Shows the element inside a container of your page. A visitor in the A/B holdout gets nothing at all.

mount(target: HTMLElement | string): void;
targetHTMLElement | stringRequired

A CSS selector or an element. Put it where the shopper chooses a size.

TryYourSizeError with code mount_not_found, already_mounted or element_destroyed.

const guide = elements.create("sizeGuide", { product: "SKU-123" });
guide.mount("#size-guide"); // or guide.mount(document.querySelector(".size-row"))

Was this page helpful?