# How to embed JavaScript script in front of ,\</body\> tag

**URL:** <https://meta.discourse.org/t/how-to-embed-javascript-script-in-front-of-body-tag/279159>\
**Category:** Development\
**Created:** [September 15, 2023, 2:34pm UTC](https://meta.discourse.org/t/how-to-embed-javascript-script-in-front-of-body-tag/279159 "2023-09-15T14:34:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![zengyunsi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zengyunsi/32/265722_2.png) [@zengyunsi](https://meta.discourse.org/u/zengyunsi)\
**Post date:** [September 15, 2023, 2:34pm UTC](https://meta.discourse.org/t/how-to-embed-javascript-script-in-front-of-body-tag/279159/1 "2023-09-15T14:34:16Z")

</div>

I want to change a style for video in discourse, how to embed JavaScript script before ,`</body>` tag

Tried editing it in the HEAD, it doesn’t work perfectly!

Thanks!

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/5/a/85aa174e5139d09876af65cb5368267f60cab73b.jpeg)

```plaintext
      <script src="/plyr.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            const player = new Plyr('video');
        });
    </script>

```

```plaintext
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Video Player</title>
    <link rel="stylesheet" href="https://cdn.plyr.io/3.6.12/plyr.css">
    <script src="https://cdn.plyr.io/3.6.12/plyr.js"></script>
</head>
<body>
    <video controls>
        <source src="your-video.mp4" type="video/mp4">
    </video>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            const player = new Plyr('video');
        });
    </script>
</body>
</html>

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-embed-javascript-script-in-front-of-body-tag/279159)._
