adjusted input methods

This commit is contained in:
alisolarflare 2017-06-15 17:16:00 -06:00
parent 8cdcad37a9
commit 0cb14f6f8e

View file

@ -2,7 +2,7 @@
window.onload = function(){ window.onload = function(){
addScenario = function(scenario){ addScenario = function(scenario){
let $liElement = $("<li id=\"scenarios-${scenario.name}\"></li>") let $liElement = $("<li id=\"scenarios-"+scenario.name+"\"></li>")
if(scenario.adult == true){ if(scenario.adult == true){
$adultText = $("<p class=\"adult\">(question for those over the age of 18... or those mature enough)</p>"); $adultText = $("<p class=\"adult\">(question for those over the age of 18... or those mature enough)</p>");
@ -12,16 +12,15 @@ window.onload = function(){
$options = $("<ul></ul>"); $options = $("<ul></ul>");
for(option of scenario.options){ for(option of scenario.options){
$options.append($("<li>" + option + "</li>")); $options.append($("<li><input type=\"radio\" name=\"radio-"+scenario.name+"\">" + option + "</radio></li>"));
} }
$question = $("<p>" + scenario.question + "</p>"); $question = $("<p>" + scenario.question + "</p>");
$input = $("<input type=\"text\" placeholder=\"Enter response here\">"); $textArea = $("<textArea placeholder=\"Enter response here\"></textArea>")
$liElement.append($description); $liElement.append($description);
$liElement.append($options); $liElement.append($options);
$liElement.append($input); $liElement.append($textArea);
$("#scenarios").append($liElement); $("#scenarios").append($liElement);
} }