How to add Event Listener 'click' on Rect of Element?

Hello, I am trying to add Event Listener on click to the red dot that appears on the element but it doesnt work. How can I dont this?
image
My Code:

 const note = getBusinessObject(element).noteProperty;
 if(note){
      const rect = this.drawRect(parentNode, 'rect1', 15, 15, 15, 'rgb(204,0,0)');
      svgAttr(rect, {
          transform: 'translate(0, 0)'
       });
                    
      const noteRect = document.querySelector("#rect1");
      noteRect.addEventListener('click', (event)=>{console.log('clicked')});
}

This sounds like a classic use case for overlays: bpmn-js-examples/overlays at master · bpmn-io/bpmn-js-examples · GitHub