switch(something){
case "something":
document.location.href = "thankyou";
break;
case "something1":
document.location.href = "thankyou/1";
break;
case "something2":
document.location.href = "thankyou/2";
break;
case "something3":
document.location.href = "thankyou/3";
break;
.....
}
document.location.href = "thankyou/1";
Find more questions by tags JavaScriptWordPress