How can I successfully bind a click event to an input tag?

{% render 'icon', icon: 'close' %}
![Snipaste_2023-11-30_11-24-19.png|1638x526](upload://t4Ze2XQSLKasFRCp9i4x3f92BLk.png)

The click event does not seem to bind successfully, liquid this kind of file how to bind the click event, please advise everyone, thank you!

Please try this code once and see if the event is working.

btn.addEventListener('click', function(){
    console.log('working')
})

var btn = document.getElementById(‘btn’);
console.log(btn);
btn.addEventListener(‘click’, function(){
console.log(‘working’)
})

It still doesn’t work. It doesn’t print “working.”

can you give link to the page that has the button?