UMD Web Utilities Library
    Preparing search index...

    Function createLinkWithSpan

    • Creates an external link with text wrapped in a span element

      Creates an anchor element with security attributes (target="_blank" and rel="noopener noreferrer") and wraps the link text in a span element for styling purposes.

      Parameters

      • url: string

        The href URL for the link

      • title: string

        The text content for the link

      • Optionallabel: string

        Optional aria-label for accessibility

      Returns HTMLAnchorElement

      HTMLAnchorElement with span-wrapped text

      const link = createLinkWithSpan(
      'https://example.com',
      'Visit Example',
      'Opens in a new window'
      );
      document.body.appendChild(link);