$(document).ready(function () {
    //add and remove vehicle fields
    var addButton = $('#add-benefit'); //Add button selector
    var wrapper = $('.added-benefits'); //Input field wrapper
    var x = 1;
    var fieldHTML = '<div class="">' +
        '<button type="button" id="remove-button"> <i class="fa fa-trash"></i> </button>' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">Benefit Name <span class="error">*</span></div>\n' +
        '    <div class="guestDetails_input">\n' +
        '       <input type="text" name="benefit[]" class="input-text-height" size="40" placeholder="Enter Benefit Name" autocomplete="off">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">Amount/Value <span class="error">*</span></div>\n' +
        '    <div class="guestDetails_input">\n' +
        '       <input type="text" name="benefit-value[]" class="input-text-height" size="20" placeholder="Enter Value" autocomplete="off">\n' +
        '    </div>\n' +
        '</div>\n' +
        '    <div class="guestDetails_inputDivider input_divider1"></div>';

    //Once add button is clicked
    $(addButton).click(function(){
        x++; //Increment field counter

        $(wrapper).append(fieldHTML); //Add field html

    });
    //Once remove button is clicked
    $(wrapper).on('click', '#remove-button', function(e){
        e.preventDefault();
        $(this).parent('div').remove(); //Remove field html
        x--; //Decrement field counter
    });
});
