title: On change select, if item has the same value in dropdown check the checkbox
body: <p>I am creating a dynamic dropdown list out of checkboxes. What I want is when the dropdown changes (on select) I want it to check the checkboxes with the same values or perhaps with the same <code>name</code>? I also want it to do vice versa, if you <code>check</code> a checkbox the select dropdown should change as well. </p>
  
  <p>Here is my codepen - <a href="http://codepen.io/BryanBarrera/pen/QEXVxY" rel="nofollow">http://codepen.io/BryanBarrera/pen/QEXVxY</a></p>
  
  <p>I am having issues writing this. Here is what I have. What is the best approach for this? How do I match up elements to change or check the <code>checkboxes</code>?</p>
  
  <p>Any idea or suggestions would be much apprecated</p>
  
  <pre><code>"use strict";
  
  var checkBoxes = $('.form-item'),
      checkBox = $('input[type="checkbox"]'),
      $select = $('&lt;select&gt;&lt;/select&gt;').appendTo('body').wrap('&lt;div class="select-dropdown"&gt;&lt;/div&gt;');
  
  checkBoxes.each(function (n) {
      var dataText = $(this).find('label').text();
      var dataValue = $(this).find('input').val();
      $select.append('&lt;option value="' + dataValue + '"&gt;' + dataText + '&lt;/option&gt;');
  });
  
  
  $select.on('change', function(){
  
    var checkboxvalue =  $(this).val();
  
    var a =  $(this).filter(function(){return this.value=='checkboxvalue'});
  
    console.log(a);
    console.log(checkboxvalue);
  
    if (checkboxvalue == $(this).val() ) {
     // alert('yup');
    }
  });
  </code></pre>