Snippets Collections
export const getElement = (selection) => {
  const element = document.querySelector(selection);
  if (element) {
    return element;
  throw new Error(
    `Please check "${selection}" selector, no such element exists`

export const getAllElements = (elements) => {
    const allelements = document.querySelectorAll(elements);
      return allelements
    throw new Error(`These ${elements} cannot be found`)

Mon Feb 07 2022 06:44:54 GMT+0000 (UTC)

#html #tutorials #htmltutorisls #element #elementtutorisls

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension