It is possible to build a YUI TabView widget completely from script.
The first thing we need to do is load the TabView source files and dependencies:
We will create a container to insert our new TabView into. This can be any existing element on the page, including the
<body>, but for this example, we will create a
First we will create a TabView instance, omitting the
element argument, which signals the constructor to create the TabView container:
Next we add tabs to our TabView, including the label and content for each tab and set the default selected tab to "active":
All that is left is to append our new TabView to our container:
Note: You are viewing this example in debug mode with logging enabled. This can significantly slow performance.