many.html revision eae7322ef3fe4ed2c201fef237c51b28d4c333ed
<!DOCTYPE html>
<html>
<head>
<!-- reset the default browser styles -->
<style>
/* Fix this - Shouldn't require body specificity */
body .yui3-button-selected {
background-color:#426FD9;
color:white;
}
</style>
<script src='/build/yui/yui-min.js'></script>
<script>
YUI({
debug: true,
combo: false,
filter: 'raw'
}).use('button', function(Y){
Y.one("#generator").on("click", function(){
var count, button, buttons = [];
count = Y.one('#count').get('value');
Y.one("#container").empty(true);
for(var i=0; i < count; i++) {
button = new Y.ButtonGenerator( {label: i} );
Y.one("#container").append(button.getDOMNode());
buttons.push(button);
}
new Y.ButtonGroup({
buttons: buttons,
type: 'radio'
});
});
});
</script>
</head>
<body class='yui3-skin-sam'>
<h1>Buttonpalooza</h1>
How many buttons would you like? <input type="text" value="100" id="count">
<button id="generator" class="yui3-button">Make buttons!</button>
<hr />
<div id="container"></div>
</body>
</html>