HTMLDrop.
WINDOW.HTMLDROP

Answers, sharing, and selling from a page.

Every page on HTMLDrop can use a small helper, window.htmldrop, to send answers to its creator, share its own link, and sell products. It works in pages you write and in pages made with ChatGPT, Claude, or Gemini.

Collect answers

Send any small piece of data (up to 4 KB) to the person who made the page: quiz scores, RSVPs, sign-ups, feedback. Answers appear under Answers, password, and selling on the page’s menu. Only pages made with an HTMLDrop account collect answers, because a page made without one can be opened in the editor by anyone with its link. Tell visitors their answer goes to you.

htmldrop.visitor().then((visitor) => {
  if (!visitor.collects) return // this page does not collect answers
  form.hidden = false
})

htmldrop.submit({ name: "Lan", score: 8, total: 10 })
  .then(() => (status.textContent = "Sent ✓"))
  .catch((error) => (status.textContent = error.message))

Share the page

Pages run in a secure frame, so location.href is not the page’s link. htmldrop.share opens the phone’s share sheet with the real link, or WhatsApp on a computer.

htmldrop.share("I scored 8/10 on the fractions quiz!")

Sell products

Connect your Stripe account and add products with their prices on the page’s Sell tab. The page reads them and sends buyers to Stripe’s checkout. Prices are set in HTMLDrop, never in the page, so nobody can change what they pay. When a buyer comes back, the page receives a htmldrop:paid event.

const products = await htmldrop.products()
// [{ id: "p_1a2b3c", name: "Sourdough loaf", price: "$6.00", amount: 600, currency: "usd" }]

buyButton.onclick = () => htmldrop.buy(products[0].id, 2)
// or several at once: htmldrop.buy([{ product: "p_1a2b3c", quantity: 2 }])

addEventListener("htmldrop:paid", () => (thanks.hidden = false))

Ask your AI

Make a 10-question quiz as one HTML page. At the end, ask for the
student’s name and send it with the score using
htmldrop.submit({ name, score, total }). Only show that form when
htmldrop.visitor() says collects is true.

Good to know

  • In the editor’s preview, nothing is saved or charged: the console shows what would happen.
  • Free accounts see the latest 10 answers; Pro sees them all and downloads a spreadsheet.
  • Pages that ask visitors to sign in show each answer with the visitor’s name and email.
  • HTMLDrop keeps 5% of each sale (2% with Pro), on top of Stripe’s fees. Refunds and payouts are in your own Stripe dashboard.
  • Stripe pays sellers in about 46 countries.
  • Sales tax and VAT can be added automatically with Stripe Tax on your own Stripe account (0.5% per sale, billed by Stripe), in the countries where you are registered. Choose on the Sell tab whether each product is physical, digital, or a service.
Made to be explored. Open the workspace and try it for yourself. Coming from CodePen or JSFiddle? See how HTMLDrop compares.