# Klikondersteuning toevoegen aan 'Header Submenus' component

**URL:** https://meta.discourse.org/t/add-click-support-to-header-submenus-component/268503
**Category:** Development
**Tags:** header-submenus
**Created:** [15 juni 2023 om 17:58 UTC](https://meta.discourse.org/t/add-click-support-to-header-submenus-component/268503 "2023-06-15T17:58:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Scott\_Hurrey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_hurrey/32/286764_2.png) [@Scott\_Hurrey](https://meta.discourse.org/u/Scott_Hurrey)
#### Post date: [15 juni 2023 om 17:58 UTC](https://meta.discourse.org/t/add-click-support-to-header-submenus-component/268503/1 "2023-06-15T17:58:22Z")

</div>

I am using the Header submenus theme component to style our header to match our other developer properties. There is a top-level ‘Community’ item in the header, but with the plugin, top-level entries don’t have an href associated. I wrote some simple javascript to catch the click event and send them to the home page. It works fine in my simple test html and if I open the javascript console in my site and type the javascript in, it works on my site. I just can’t figure out where to put it in my theme to add the functionality.

I have tried adding it to all of the available options, but the javascript never runs. If I put it in Head, I get an error because it loads referencing a DOM object that doesn’t yet exist, so I know it _sees_ it, but it never works.

I appreciate any guidance y’all can provide.

Thanks!

---

<div class="post-metadata">

### Author: ![Scott\_Hurrey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_hurrey/32/286764_2.png) [@Scott\_Hurrey](https://meta.discourse.org/u/Scott_Hurrey)
#### Post date: [15 juni 2023 om 20:52 UTC](https://meta.discourse.org/t/add-click-support-to-header-submenus-component/268503/2 "2023-06-15T20:52:50Z")

</div>

I figured it out.

Here’s the [code](https://github.com/box-community/box-discourse-theme/blob/main/desktop/head_tag.html) if anyone else needs to do something similar.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [15 juli 2023 om 20:53 UTC](https://meta.discourse.org/t/add-click-support-to-header-submenus-component/268503/3 "2023-07-15T20:53:03Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
