News for hackers. Stuff that matters.
Re:Gov.uk drops jQuery from their front end by bern4444 on Thursday May 19, 2022 @11:03PM (#31442879)
Even easier:

  export const hideElementById = (elementId) => {
    document.getElementById(`#${elementId}`).style.display = 'none'
  };
Or perhaps

  export const toggleElementById = (elementId) => {
    const element = document.getElementById(`#${elementId}`);

    const newDisplayValue = element.style.display === 'none' ? 'block' : 'none';

    element.style.display = newDisplayValue;
  };

There are no comments on this comment yet.