Attribute Equals Selector [name=value]

attributeEquals selector

version added: 1.0jQuery('[attribute=value]')

  • attribute
    An attribute name.
    An attribute value. Quotes are optional.

Description: Selects elements that have the specified attribute with a value exactly equal to a certain value.


Finds all inputs with name 'newsletter' and changes the text of the span next to it.

<!DOCTYPE html>
  <script src=""></script>

    <input type="radio" name="newsletter" value="Hot Fuzz" />

    <input type="radio" name="newsletters" value="Cold Fusion" />

    <input type="radio" name="accept" value="Evil Plans" />

<script>$("input[name='newsletter']").next().text(" is newsletter");</script>