Removing Elements Dynamically

Source: https://www.abeautifulsite.net/adding-and-removing-elements-on-the-fly-using-javascript

  • function removeElement(elementId) {
  • // Removes an element from the document
  • var element = document.getElementById(elementId);
  • element.parentNode.removeChild(element);
  • }

Không có nhận xét nào:

StaticImage

  import React , { useEffect , useRef } from "react" import { StaticImage } from "gatsby-plugin-image" impor...