Element Selector (“element”)

element selector

Description: Selects all elements with the given tag name.

  • version added: 1.0jQuery( "element" )

    element: An element to search for. Refers to the tagName of DOM nodes.

JavaScript's getElementsByTagName() function is called to return the appropriate elements when this expression is used.


Finds every DIV element.

<!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <title>element demo</title>
  div, span {
    width: 60px;
    height: 60px;
    float: left;
    padding: 10px;
    margin: 10px;
    background-color: #eee;
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
$( "div" ).css( "border", "9px solid red" );


© The jQuery Foundation and other contributors
Licensed under the MIT License.