The button
I want to get it to work with an event listener like this one:
document.body.addEventListener('click', function(e) {
console.log(e.target);
if (e.target.hasAttribute('data-a-target="popout-chat-button"')) {
console.log('popout button');
}
});
<button data-a-target="popout-chat-button" data-test-selector="popout-button">Popout</button>
I can't check the value with hasAttribute, what would be the best approach to do so.