you are here: codestackercodes [RSS] → tag select [RSS]

select criado por javascript

list_options = Array("A", "B", "C");
var select = document.createElement("select");
select.name = "exam[question_attributes][][right]";

for (i = 0; i < list_options.length; i++){
	option = document.createElement("option");
	option.text = list_options[i];
	option.value = i
	select.options.add(option);
}
Displaying 1 Code