I would like to add javascript to the `<head>` of my webpage from within tags.

This is the moreScripts equivalent I'm using on my pages:

**main.scala.html**

```
@(title: String, scripts: Html = Html(""))(content: Html)
<!DOCTYPE html>
<html lang="nl">
    <head>
        <title>@title</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        @scripts
    </head>
    <body>
        @content
    </body>
</html>

```

**page.scala.html**

```
@scripts = {
    <script type="text/javascript">
        $(document).ready(function() {
            alert(1);
        });
    </script>
}
@main("Title", scripts) {
    <p>page content</p>
}

```

So far so good! However I want to do the same from within a tag (component) I've written that needs to include some javascript code into the webpage.

My question is how can I pass a `<script>` element from the tag to the `main.scala.html`?

So the `page.scala.html` would be:

**page.scala.html**

```
@import tags._
@main("Title") {
    @mytag("green")
}

```

**mytag.scala.html**

```
@(color: String)
<script type="text/javascript">
    $(document).ready(function() {
        alert('@color');
    });
</script>

<p>Some more content</p>

```

In this case the `<script>` tag is rendered halfway the HTML page, I want to pass the `<script>` tag into the `@scripts` variable so it can be rendered inside the `<head>` tag.