toggleGroupVisibility = (groupHeaderElement) => {
  let displayValue
  if (groupHeaderElement.className.includes('open')) {
    groupHeaderElement.classList.remove('open')
    groupHeaderElement.classList.add('closed')
    displayValue = 'none'
  } else {
    groupHeaderElement.classList.remove('closed')
    groupHeaderElement.classList.add('open')
    displayValue = ''
  }

  const inputRowsInGroup = document.getElementsByClassName(groupHeaderElement.dataset.groupname)
  Array.from(inputRowsInGroup).forEach((item) => {
    item.style.display = displayValue
  })
}
Given the Table Row element for a group header, show or hide the elements of the group.
@param groupHeaderElement