> For the complete documentation index, see [llms.txt](https://docs.idew.org/code-internet-of-things/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idew.org/code-internet-of-things/tutorials/create-security-system/4.7-web-app-html.md).

# D-7 Web App HTML

Next, you'll create a web app that will interact with your Smart Security device through Particle Cloud.

Your web app will consist of an HTML file named`index.html`, a CSS file named `style.css`, and a JavaScript file named `script.js`.

Remember that Particle Build is only used to code your Photon device app. You'll need to use a different code editor to create the HTML, CSS, and JS files for your web app. Consult your teacher to determine which code editor will be most appropriate to use for your web app files.

## Add Starter HTML

[Copy this starter HTML for your web app](https://docs.idew.org/code-internet-of-things/references/web-app#html), and paste it into a **blank** HTML file named `index.html`.

The starter HTML contains blank lines where you'll add custom HTML for your specific web app.

## Add Custom HTML

Copy this HTML, and paste it into the blank lines **within** the `<body>` of your starter HTML code:

```markup
        <h2>Smart Security System</h2>
        <div class="card">
            <h2 id="system-mode">Connecting...</h2>
            <label class="switch">
                <input type="checkbox" name="toggle" onclick="toggleMode();">
                <span class="slider round"></span>
            </label>
            <h3>Last Motion Event</h3>
            <p id="event-time">None</p>
        </div>
        <div id="motion-alert" class="card">
            <h2>Motion Detected</h2>
        </div>
```

{% hint style="success" %}
**COPY CODE:** When using this IoT code guidebook, you can copy a code block simply by clicking the **copy icon** displayed in the upper right of the code block.
{% endhint %}

## Preview Web App

If you preview the web app at this point, it's very plain (because there's no CSS in the `style.css` file) and it doesn't function yet (because there's no JS in the `code.js` file).

<div align="left"><img src="/files/-LKI9AMz5UL6LmL0S3n8" alt=""></div>

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.idew.org/code-internet-of-things/tutorials/create-security-system/4.7-web-app-html.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
