Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theflowglenn/2555d3894348336a65f3e017184d86df to your computer and use it in GitHub Desktop.
Save theflowglenn/2555d3894348336a65f3e017184d86df to your computer and use it in GitHub Desktop.
Used in Webflow projects when you want to use hidden Collections to set sensible values for checkboxes
<script>
// Dynamically create the Category dropdown from the Collection Data
$('.category-select-option-pair').each(function() {
var dv = $(this).children('div').eq(0).text();
var av = $(this).children('div').eq(1).text();
$('.category-dynamic-dropdown').append('<option value="' + av + '">' + dv + '</option>');
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment