Skip to content

Instantly share code, notes, and snippets.

@momota10
Last active January 10, 2016 05:40
Show Gist options
  • Save momota10/0327481b1c8fee0f9b7a to your computer and use it in GitHub Desktop.
Save momota10/0327481b1c8fee0f9b7a to your computer and use it in GitHub Desktop.
module.exports = function() {
$(function() {
var num = 0
$('#add-birthday-setting').on('click', function() {
num = parseInt($("#birthday-table tbody tr:last").attr('id').match(/[0-9]/))
var tr = $('#birthday-setting\\['+num+'\\]')
num++
tr.clone(true)
.insertAfter(tr)
.attr('id', 'birthday-setting['+num+']')
.end()
})
$('#delete-project-setting').on('click', function() {
$(this).parent().parent().remove()
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment