JavaScript problem with switching tabs

I'm working on a FrontLoops JavaScript challenge. You should be able to cycle through three elements by clicking on the Change tab button. You should also be able to type in a number from 1 to 3, representing each tab index. Right now, I can cycle through the elements with the button but once I type in a value, I can't cycle anymore. Can anyone take a look and help me figure out what I'm doing wrong?

https://codepen.io/savvystrider/pen/eYQQqqK
Was this page helpful?