The best way to copy the the input values between two view
<p>I have two different views which have the same number of fields (checkbox type) to be filled out.</p>

<p>I need to copy the values from one view to the other when clicking on the copy button..</p>

<p>Here is my code which works:</p>

<pre><code>$('button').on('click', function () {
    var firstInputSet = $('#contest_data_updatePeriodicity').find('input'),
        secondInputSet = $('#contest_data_reminderPeriodicity').find('input');
    for (var i = 0; i &lt; firstInputSet.length; i ++) {
        //console.log($(firstInputSet[i]).prop('checked'));
        $(secondInputSet[i]).prop('checked', $(firstInputSet[i]).prop('checked'))
    }
});​
</code></pre>

<p>I would like to know if there is a best way to do this job.</p>

<p>Here is the demo:</p>

<p><a href="http://jsfiddle.net/D2RLR/2639/" rel="nofollow">http://jsfiddle.net/D2RLR/2639/</a></p>
