Has attribute selector [name]

Has Attribute Selector [name]

attributeHas selector

Description: Selects elements that have the specified attribute, with any value.

  • version added: 1.0jQuery( "[attribute]" )

    attribute: An attribute name.

Example:

Bind a single click to divs with an id that adds the id to the div's text.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">