> For the complete documentation index, see [llms.txt](https://docs-plus.dropzone.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-plus.dropzone.dev/how-to-submit-data/with-javascript.md).

# With JavaScript

There are many ways to send data via JavasScript. This would be one of the easiest solutions:

```markup
<button onclick="submit()">Submit data</button>

<script>
  function submit() {
    let data = { name: 'Some name', someRandomData: 'some value' };
    fetch("https://plus.dropzone.dev/_p/{YOUR_PROJECT_ID}", {
      method: "POST",
      body: JSON.stringify(data),
      headers: { "Content-Type": "application/json" },
    });
  }
</script>
```

This encodes the data as JSON and sends it to **Dropzone Plus**. Please note that the `Content-Type` needs to be set appropriately for it to be recognized.
