In short
HTML provides the form, CSS controls its appearance, and TypeScript calculates the result.
A browser still needs JavaScript, so the one-file example converts the typed code in the page before running it.
Use this route for a small demo. Compile first when the page is public, large, or part of a multi-file project.
The NOS Team made a fictional workshop seat calculator to test the whole route. The first page used three seats at 12 units each and showed 36. We then changed the input to four seats, checked the 48 result, cleared the field to trigger the error message, and edited the heading. The same public address showed the revised heading.

How do HTML, CSS, and TypeScript work together?
Each layer has one job in this example. HTML supplies the two fields, the button, and the result area. CSS sets the spacing, colors, and phone layout. TypeScript reads the field values, checks the allowed range, multiplies the numbers, and chooses either a total or an error message.
That split matters when something breaks. A missing field is an HTML problem. A cramped card is a CSS problem. A button that does not update the total points to the browser code or the conversion step.

Download the complete fictional HTML, CSS, and TypeScript example. The file includes the form, styles, typed calculator logic, and the conversion step in one place.
How do I run TypeScript in HTML with no build step?
- Write a complete page. Keep the HTML structure and CSS in the same file.
- Keep the typed code as data. The browser must not try to execute the TypeScript before it is converted.
- Load a pinned browser compiler. The example uses one fixed compiler file rather than an address that can change under it.
- Convert, run, and check the result. The page turns the typed block into JavaScript, runs it, and displays a ready line only after that succeeds.
This arrangement is useful for a compact lesson or a self-contained prototype. It is not the usual production route because every visitor must fetch the compiler before the calculator can work.
How can I share the working result?
Open Share after the page works in View. Copy the reader address from that panel, then open it in a separate phone-size window. That check separates an editor-only success from the page a reader actually receives.


The public check showed both the default total and the ready line. That confirmed the compiler resource loaded at the reader address rather than only inside the editor.
Does the TypeScript calculator really respond to input?
Yes. We replaced 3 with 4 in the Seats field and pressed Calculate total. The result changed from 36 to 48 while the per-seat value stayed at 12.

This is the useful completion test: change the value, trigger the action, and read the new result. A page that merely looks correct has not proved that its typed logic ran.
What happens with empty or invalid input?
Clearing Seats and pressing the button produced “Enter 1 to 20 seats.” The calculator did not reuse the old total. This failure state is important because TypeScript types disappear after conversion; a form still needs checks for values supplied by a person.

The example also rejects zero, negative values, fractions, and values above 20 for the seat count. That is a rule in this fictional calculator, not a general TypeScript limit.
Does in-page conversion check my types?
No. The conversion used here handles one block and produces JavaScript. It removes type annotations, but it is not a substitute for a full project type check. A wrong value can still reach the running page unless the form logic rejects it.
Use a TypeScript-aware editor or a normal project build when you need type errors across files. The official TypeScript handbook also explains that type annotations are erased and do not change runtime behavior.
Should I compile TypeScript before publishing?
Usually, yes. Compile first when the page is meant for regular public use. Readers then receive the smaller JavaScript output instead of downloading a compiler. A build also fits imports, shared types, tests, and more than one source file.
The one-file route earns its place when the file itself is the lesson or portable demo. If you are ready to bundle separate source files, the esbuild HTML guide shows how to assemble the output into one page.
Can I update the shared page without making another link?
We opened Edit on the existing fictional page and changed only the heading from Northstar Workshop to Northstar Workshop Lab. After Done returned the page to View, the original public address showed the new heading.


That edit did not alter the calculator values or its behavior. For a page that opens but does not react, work through HTML JavaScript not working before creating another address.
When not to do this
- Do not use in-page conversion when startup size matters or the page will receive steady public traffic.
- Do not treat a successful conversion as proof that the types are correct.
- Do not use one file when the project already depends on imports, shared packages, or a repeatable build.
- Do not place private records, passwords, or payment information in a public example.
Using NOS for a TypeScript HTML demo
NOS Workspace can hold the complete HTML file, show its rendered result, and create a reader link for the working page. For this test, the public link ran the calculator, showed the empty-input warning, and reflected the saved title edit. If you only need the sharing steps, use the HTML to link tool.