About 704,000 results
Open links in new tab
  1. Document: getElementsByClassName() method - Web APIs | MDN - MDN Web Docs

    Jun 3, 2025 · The getElementsByClassName method of Document interface returns an array-like object of all child elements which have all of the given class name(s). When called on the …

  2. How to use getElementsByClassName in javascript-function?

    Jan 26, 2015 · getElementsByClassName Returns a set of elements which have all the given class names. var elements = document.getElementsByClassName('boxes'); for(var i=0, …

  3. javascript - How to correctly iterate through getElementsByClassName

    var activeObjects = documents.getElementsByClassName('active'); // a live nodeList //Use a reverse-loop because the array is an active NodeList while(activeObjects.length > 0) { var …

  4. javascript - How to get element by class name? - Stack Overflow

    You need to use the document.getElementsByClassName('class_name'); and dont forget that the returned value is an array of elements so if you want the first one use: …

  5. Element: getElementsByClassName() method - Web APIs | MDN - MDN Web Docs

    Apr 10, 2025 · Learn about the Element.getElementsByClassName () method, including its syntax, code examples, specifications, and browser compatibility.

  6. HTML DOM Document getElementsByClassName() Method - W3Schools

    The getElementsByClassName() method returns a collection of elements with a specified class name(s). The getElementsByClassName() method returns an HTMLCollection.

  7. JavaScript getElementsByClassName() Method - JavaScript

    In this tutorial, you will learn how to use the JavaScript getElementsByClassName() method to select elements by class name.

  8. JavaScript getElementsByClassName() - JavaScript Guide

    Jul 27, 2022 · JavaScript’s Document.getElementsByClassName() method returns a live array-like object containing all the elements that have all the specified class names. Syntax …

  9. HTML DOM getElementsByClassName () Method

    Sep 2, 2024 · The getElementsByClassName() method in Javascript returns an object containing all the elements with the specified class names in the document as objects. Each element in …

  10. HTML DOM getElementsByClassName() 方法 | 菜鸟教程

    HTML DOM getElementsByClassName() 方法 Document 对象 实例 获取所有指定类名的元素: var x = document.getElementsByClassName('example'); 尝试一下 » 定义和使用 …

Refresh