Use querySelector to get select based on two conditions, one being a prefix
Solution 1:
Use an actual class selector (.
) for the fixed class name part.
let delayselect = document.querySelector(`.${classname}[class*='delay-']`);
The backticks ("template literals") allow for simpler inclusion of expressions in strings.