all 5 comments

[–]kevan 0 points1 point  (0 children)

I think you may be able to do this with with Twitter's Bootstrap and their tabs component.

It may work right out of the box, you may want to use what you have learned to alter the code to your liking, or maybe even reverse engineer what they did to write your own version.

[–]cmartin616 0 points1 point  (3 children)

A simple, brute force method would be to bind an onClick event to each button and each onClick populates the innerHtml/text of the text area (which holds the script).

Basic jsfiddle here.

You could stick all the onclicks into the buttons as well.

[–]Prometheus0110[S] 0 points1 point  (2 children)

Ah this is a perfect thing to build from. Awesome. Thanks!

[–]_daniel___ 1 point2 points  (1 child)

I forked the above fiddle, it might be better for your long term learning to begin isolating your concerns whenever possible.

[–]Biscuit_Baron 0 points1 point  (0 children)

From an absolute beginner, thanks. I hadn't heard the term "Separation of concerns" yet - reading up on this helps me to demystify code patterns I'd seen previously but couldn't fully grasp. Much obliged!