Skip to content

findByName

Toke Voltelen edited this page Dec 4, 2016 · 2 revisions

findByName(names)

Find DOM elements with the given name

Parameters

  • names (String|Array<String>) - Value of name attribute to find the elements by
  • returns (Array<HTMLElement>) - List of found DOM elements

Usage

import findByName from 'vanillajs-browser-helpers/findByName';

// Basic
findByName('some-name');

// Multiple names
findByName('some-name, another');
findByName(['some-name', 'another']);
Clone this wiki locally