Function el

Selects a single HTML element based on the provided CSS selector.

const header = el('header');
if (header) console.log('Header element found:', header);
  • Parameters

    • selectors: string

      A string containing one or more CSS selectors to match.

    Returns null | HTMLElement

    The first HTML element that matches the specified selector, or null if no matches are found.