So dynamic that you can modify native objects if you so choose. . elements = element. To select the multiple elements with the same data attribute name, we need to use the document.querySelectorAll () method by passing a [data-attribute] as an argument. I like writing tutorials and tips that can help other developers. You can use the CSS attribute selectors to select an HTML element by name using jQuery. node.getAttribute(attribute_name) Return a node/element's attribute value. For example, to get the value of the input element, get the value attribute. Topic: JavaScript / jQuery Prev|Next. If no elements are found, the HTMLCollection is empty. One dynamic property I've frequently been using lately is the attributes property of DOM elements. How to use jQuery hasAttribute() method to see if there is an attribute on an element? I'm not too familiar with JS, so just three generic notes: It seems to me that the elements[i].attributes.length > 0 check is unnecessary because the statements inside the following for loop won't if elements[i].attributes.length is zero.. It means that the return elements are automatically updated when elements with the same name are inserted and/or removed from the document. So dynamic that you can modify native objects if you so choose. Here's how to get element in a HTML. [attr~="word"]), which is … The HTML