Random names and rolls working.

This commit is contained in:
Eric Fredricksen
2010-06-24 14:20:35 -07:00
parent 984f3b8e90
commit 56cb1f3970
2 changed files with 49 additions and 70 deletions
+2 -19
View File
@@ -21,8 +21,8 @@ input, button { display: inline; }
<div class="hbox">
Name
<input id=Name>
<button id=RandomName>?</button>
<input id="Name">
<button id="RandomName">?</button>
</div>
<div class=hbox>
@@ -68,22 +68,5 @@ input, button { display: inline; }
</div>
<script>
function fill(e, a, n) {
var def = Random(a.length);
for (var i = 0; i < a.length; ++i) {
var v = a[i].split("|")[0];
var check = def == i ? " checked " : " ";
$("<div><input type=radio name=\"" + n + "\" value=\"" + v + "\" " +
check +">" + v + "</div>").appendTo(e);
}
}
fill("#races", K.Races, "Race");
fill("#classes", K.Klasses, "Class");
//$(document).ready(function(){});
</script>
</body>
</html>