Here is the snippet of code I'm working on:
<div class="pop-up-chat">
<div id="div1">
<div class="pop-up-msg regular-text">Hi, how can I assist you?</div>
<div class="triangle-down"></div>
</div>
</div>
Currently, I am trying to target the pop-up-chat div and add a 5-second delay before hiding it. However, it seems to be encountering some issues. Can you spot the problem?
export default {
name: 'PopUpMsg',
mounted() {
this.msgShow();
},
methods: {
msgShow() {
const msg = document.getElementsByClassName('pop-up-chat');
setTimeout(() => {
msg.style.visibility = 'hidden';
}, 5000);
},
},
}