Skip to content

Instantly share code, notes, and snippets.

@dgbrahle
Created July 7, 2010 18:16
Show Gist options
  • Save dgbrahle/467039 to your computer and use it in GitHub Desktop.
Save dgbrahle/467039 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<script language="javascript" type="text/javascript">
function showanswer()
{
if (!document.html)
return
document.html.num_answers.src=
document.answerMC.num_ans.options[document.answerMC.num_ans.selectedIndex].value
}
function insertABunchOfElements(){
var txt = "Dave";
var newtext = document.createTextNode(txt);
document.body.appendChild(newtext);
}
function insertABunchOfFields(){
var answerCount = //whatever the user has selected from the dropdown
for(i=0; i<=5; i++)
{
var li = document.createElement("li");
var input = document.createElement("input");
input.id = i;
input.name = i;
input.type = "text";
li.appendChild(input);
field_area.appendChild(li);
}
</script>
</head>
<body>
<select onchange="insertABunchOfElements();">
<option selected value="Click">Click</option>
<option value="Test">Test</option>
<option value="13">13</option>
</select>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment