Skip to content

Instantly share code, notes, and snippets.

@rnavarro
Created June 21, 2011 04:05
Show Gist options
  • Save rnavarro/1037215 to your computer and use it in GitHub Desktop.
Save rnavarro/1037215 to your computer and use it in GitHub Desktop.
$(document).ready(function(undefined) {
function removeMovement(obj) {
$(obj).parent().remove();
}
function addMovement(count) {
next = count+1;
html = '<div id="movement'+count+'">\
<button type="button" onClick="removeMovement(this);">remove</button>\
<select name="movement'+count+'">';
html += '<option>Missionary</option>';
html += '<option>Doggy</option>';
html += '<option>Reverse Cowgirl</option>';
html += '</select>\
<br />\
</div>';
$("#movements").append(html);
}
$("#addmovement").click(function() {
addMovement($('#movements').children().length);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment