# Cómo insertar un nuevo elemento DOM en el widget search-menu

**URL:** https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722
**Category:** Development
**Created:** [28 Enero, 2019 13:11 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722 "2019-01-28T13:11:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![vadim0426](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vadim0426](https://meta.discourse.org/u/vadim0426)
#### Post date: [28 Enero, 2019 13:11 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722/1 "2019-01-28T13:11:27Z")

</div>

Hi.

I am trying to modify html for search-menu widget via overriding html method. Anybody can help me please? I am new in discourse forum and may be I don’t understand something. All I need to do it’s add div element to search menu. It’s not hard to do for components - I can use didInsertElement and use jquery for working with DOM. But what about widget?

Thank you.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [28 Enero, 2019 13:13 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722/2 "2019-01-28T13:13:18Z")

</div>

Are you only trying to add new elements or are you trying to modify what’s already there?

---

<div class="post-metadata">

### Author: ![vadim0426](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vadim0426](https://meta.discourse.org/u/vadim0426)
#### Post date: [28 Enero, 2019 13:18 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722/3 "2019-01-28T13:18:40Z")

</div>

Yes, I am trying to add new element. Search component has own html prepared by html() method. I want to add new DOM element to the end of this html. I am trying to use:

```plaintext
api.reopenWidget('search-menu', {
                html() {
                }
            });

```

for modification.

---

<div class="post-metadata">

### Author: ![vadim0426](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vadim0426](https://meta.discourse.org/u/vadim0426)
#### Post date: [28 Enero, 2019 13:22 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722/4 "2019-01-28T13:22:38Z")

</div>

To be more precise I changed the stylesheet for this component and made it fullscreen. I can close it via pressing ECS and I want to add close link element to this component.

---

<div class="post-metadata">

### Author: ![vadim0426](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vadim0426](https://meta.discourse.org/u/vadim0426)
#### Post date: [28 Enero, 2019 13:27 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722/5 "2019-01-28T13:27:35Z")

</div>

Here is screenshot

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/f/5f1c94d8cf0b7d2afb4a4a8fdb9eadcb34839570.png)

It’s default popup for searching…

---

<div class="post-metadata">

### Author: ![isaac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/isaac/32/235758_2.png) [@isaac](https://meta.discourse.org/u/isaac)
#### Post date: [6 Febrero, 2024 18:05 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722/6 "2024-02-06T18:05:07Z")

</div>

El menú de búsqueda del widget ya no [existe](https://github.com/discourse/discourse/pull/25545)
