# Want to know how to listen to the click event of the search notes menu

**URL:** <https://pdfjs.community/t/want-to-know-how-to-listen-to-the-click-event-of-the-search-notes-menu/703>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [April 15, 2021, 7:31am UTC](https://pdfjs.community/t/want-to-know-how-to-listen-to-the-click-event-of-the-search-notes-menu/703 "2021-04-15T07:31:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![351691555](https://avatars.discourse-cdn.com/v4/letter/3/d78d45/32.png) [@351691555](https://pdfjs.community/u/351691555)\
**Post date:** [April 15, 2021, 7:31am UTC](https://pdfjs.community/t/want-to-know-how-to-listen-to-the-click-event-of-the-search-notes-menu/703/1 "2021-04-15T07:31:55Z")

</div>

“version”: “7.2.0”,

![WechatIMG379](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/820760e18adcd25e3e9d68f63d9fd5c635c44939.png)

I want to monitor the click of the search button, but I found that there is no related api, so I replaced his button and added a click event, but found that the active on his button was not added

 ![WechatIMG380](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/4e83ca46d8542bc24e7fd0c1f8d0275f8dcc7ef2.png)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [April 15, 2021, 7:31am UTC](https://pdfjs.community/t/want-to-know-how-to-listen-to-the-click-event-of-the-search-notes-menu/703/2 "2021-04-15T07:31:56Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

- [Trigger ‘mouseMove’ and ‘click’ event while drawing an annotation](https://pdfjs.community/t/trigger-mousemove-and-click-event-while-drawing-an-annotation/93/2)
- [How can I add a spinner or a loader after performing annotations on pdf?](https://pdfjs.community/t/how-can-i-add-a-spinner-or-a-loader-after-performing-annotations-on-pdf/377/4)
- [Hiding/Showing DOM elements in WebViewer UI - List of elements](https://pdfjs.express/documentation/ui-customization/hiding-elements#list-of-elements)
- [Compiled Webviewer Installation](https://pdfjs.community/t/compiled-webviewer-installation/209/3)
- [WebViewerInstance - setActivePalette(toolName, colorPalette)](https://pdfjs.express/api/WebViewerInstance.html#setActivePalette__anchor)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [April 15, 2021, 4:44pm UTC](https://pdfjs.community/t/want-to-know-how-to-listen-to-the-click-event-of-the-search-notes-menu/703/3 "2021-04-15T16:44:41Z")

</div>

Hi!

Instead of manually replacing that button, it might be better to just add your own event listener to it.

```javascript
  const ele = instance.iframeWindow.document.querySelector('[data-element="searchButton"]')

  ele.addEventListener('click', () => {
    console.log('test');
  })

```

I hope this helps!

Thanks,  
Logan
