I was just wondering if there would be away i can check if a last div with same class name contains a certain word and if the certain word exists run a function.
every time i tried to search for help all i find is all in jquery
var words = #hey, #join, #slap
var nodes = document.querySelectorAll('.hud-chat-message');
var last = nodes[nodes.length- 1];
// Check for certain words here in nodes last
<div id="hud-chat" class="hud-chat">
<div class="hud-chat-message">
<strong>Name</strong>: text here
</div>
<div class="hud-chat-message">
<strong>Name</strong>: text here
</div>
<div class="hud-chat-message">
<strong>Name</strong>: just more text here
</div>
<div class="hud-chat-message">
<strong>Name</strong>: text here
</div>
<div class="hud-chat-message">
<strong>Name</strong>: /join
</div>
<div class="hud-chat-message">
<strong>Name</strong>: text here
</div>
<div class="hud-chat-message">
<strong>Name</strong>: /slap
</div>
</div>