hey i was just wondering if someone could help me work out way my script is not working i'm trying to get it to update the speed for the setInterval using a input number box but it does not seen to update the value each time the value is change in the input and i really don't get why this is happening any ideas why?
var nametags = null;
var nametag = document.getElementById('names');
var speed = document.querySelector('input[id="speeds"]');
var partyTags = function() {
clearInterval(nametags);
if (nametags !== null) {
nametags = null;
} else {
var delay = speed.value;
nametags = setInterval(function() {
document.getElementsByClassName('hud-party-tag')[0].value = '&#' +
Math.random().toString(9).substring(9, 5) + ' ' + [nametag.value] + ' ' + '&#' +
Math.random().toString(9).substring(9, 5);
}, delay);
}
}
speed.addEventListener("input", partyTags);
partyTags();
<input type="number" id="speeds" value="1000">
<input type="text" maxlength="35" id="names" value="NAME HERE">
<br>
<br>
<input type="text" class="hud-party-tag" disabled>