My issue is very similar to these questions, where I am trying to use a link to change tabs, but the link only changes the tab content, but not the active tab.
Most
You are including your script file before you import jQuery and the bootstrap javascript files.
Since your code requires both of these libraries, you need to move your script2.js
underneath your other scripts:
Your browsers javascript console will contain a message along the lines of:
$ is not defined.
this should always be the first place you look.
Your code works fine when used correctly: http://www.bootply.com/zP1y6wJIl1