# Html component javascript path

**URL:** <https://forums.realmacsoftware.com/t/html-component-javascript-path/47594>\
**Category:** Elements API\
**Created:** [May 16, 2025, 3:55pm UTC](https://forums.realmacsoftware.com/t/html-component-javascript-path/47594 "2025-05-16T15:55:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamorin](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jamorin/32/28957_2.png) [@jamorin](https://forums.realmacsoftware.com/u/jamorin)\
**Post date:** [May 16, 2025, 3:55pm UTC](https://forums.realmacsoftware.com/t/html-component-javascript-path/47594/1 "2025-05-16T15:55:10Z")

</div>

I’m a little confused on something. I was fiddling around with trying to create a little html component that references javascript. On a regular hand-coded site, I’d be putting a link to the javascript file at the end of the html.

Do I put my javascript in the Javascript tab in the component editor and it automatically uses that? Or how do I add the link to my file e.g ?

If I put it in the Javascript tab in the editor, is that my one true source to edit the script for all instances of the component?

I watched the videos on Creating an Element Dev Pack & Component but I dont think I necessarily want/need to create a Dev Pack

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [May 16, 2025, 4:04pm UTC](https://forums.realmacsoftware.com/t/html-component-javascript-path/47594/2 "2025-05-16T16:04:27Z")

</div>

Hey @jamorin,

Glad to hear you’re diving into Custom Components!

> [@jamorin](#):
>
> Do I put my javascript in the Javascript tab in the component editor and it automatically uses that? Or how do I add the link to my file e.g ?

Yes, you can place it in there. You can also place it in the main template area and use the [@portal function](https://docs.realmacsoftware.com/elements-docs/elements-language/bundle-structure/components/templates/portal).

```auto
@portal(headEnd)
<!-- Code here will be transported to the bottom of the page head.-->
@endportal

```

> [@jamorin](#):
>
> If I put it in the Javascript tab in the editor, is that my one true source to edit the script for all instances of the component?

Yes, it will be used in all instances of that component.

Hope that makes sense, just shout if you need more help or clarification on it. I can always do a quick video explaining more 😊
