Created
November 24, 2012 16:24
-
-
Save chyld/4140364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//= require jquery | |
//= require jquery_ujs | |
//= require_tree . | |
$(function(){ | |
$('#add_answer').click(add_answer); | |
}); | |
function add_answer() | |
{ | |
field = $('<div>'); | |
field.addClass('field'); | |
box = $('<input>'); | |
box.attr('type', 'text'); | |
box.attr('name', 'question[answers][][text]') | |
field.append(box); | |
cb = $('<input>'); | |
cb.attr('type', 'checkbox'); | |
cb.attr('name', 'question[answers][][correct]') | |
field.append(cb); | |
$('#answers').append(field); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment