Given the element
var inputAbilityName2 = document.getElementById('inputAbilityName2Id');
var inputAbilityName3 = document.getElementById('inputAbilityName3Id');
var inputAbilityName4 = document.getElementById('inputAbilityName4Id');
var inputAbilityName5 = document.getElementById('inputAbilityName5Id');
I then proceed with classList operations
inputAbilityName2.classList.replace('d-flex', 'd-none');
I need to select other elements by changing the number in the name, example I tried:
var idToChange = 5
('inputAbilityName' + idToChange).classList.replace('d-flex', 'd-none');
So that it will read inputAbilityName5.