Consider the function below:
function CheckInputType(Input) {
inputType: Input
}
If a key is pressed, I want to cycle through different input values like this:
window.addEventListener('keydown', e => {
if (9 === e.keyCode) {
e.preventDefault();
CheckInputType(0)
//Switch from 0 to 1 when key is pressed again
CheckInputType(1)
//Switch from 1 to 2 when key is pressed again
CheckInputType(2)
//And so on
}, false);
How can I achieve this functionality?