get selected index and navigate to url using window.location