Home >>jQuery Tutorial >jQuery attribute Selector

jQuery attribute Selector

jQuery [attribute] Selector

jQuery [attribute] selector in jQuery is used to selects each element with the specified attribute.


Parameter Values

Parameter Description
attribute It is a Required parameter used to specifies the attribute to find
Here is an Example of jQuery [attribute] Selector:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$("[id]").css("background-color", "#4796d6");
<h1>Welcome to Phptpoint</h1>
<p class="attr">My name is phptpoint</p>
<p>I live in Noida</p>
Who is your favourite:
<ul id="option">


Welcome to Phptpoint

My name is phptpoint

I live in Noida

Who is your favourite:
  • JAVA
  • jQuery
  • Javascript

No Sidebar ads