element

Selects all elements with the given tag name.

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

示例:

Finds every DIV element.

<!DOCTYPE html>
<html>
<head>
<style>
  div,span {
    width: 60px;
    height: 60px;
    float:left;
    padding: 10px;
    margin: 10px;
    background-color: #EEEEEE;
  }
  </style>
<script src="jquery.min.js"></script>
</head>
<body>

<div>DIV1</div>

  <div>DIV2</div>
  <span>SPAN</span>

<script>

$("div").css("border","9px solid red");

</script>
</body>
</html>
演示: