Skip to content

Instantly share code, notes, and snippets.

@chrisjangl
Created June 14, 2023 23:47
Show Gist options
  • Select an option

  • Save chrisjangl/0e77a30717b4ebc4b4c5a5b3d0745b41 to your computer and use it in GitHub Desktop.

Select an option

Save chrisjangl/0e77a30717b4ebc4b4c5a5b3d0745b41 to your computer and use it in GitHub Desktop.

Revisions

  1. chrisjangl created this gist Jun 14, 2023.
    13 changes: 13 additions & 0 deletions getEnabledIngredients.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    // set this to the ID of the group
    var group = document.querySelector('#wppizza_addingredients-custom-group-96'),
    // setting this as a variable in case it changes in the future
    ingredientClass = 'wppizza_addingredients_ingrcg_sortable';

    // find the ingredients that are enabled for this group
    group.querySelectorAll('input[type="checkbox"]:checked').forEach(function(ingredient) {
    // find the label for the ingredient
    var label = ingredient.parentElement.innerText;

    console.info(label);

    });