JQuery Attributes
A jQuery Attributes used to get the DOM attributes of elements and set those attribute values.
Most of the common attributes are
Types of Jquery attributes :
- attr("<properties>")
- used to get the value of an attribute from the first one in the matched set of attributes.
- Example:- var val = $("a").attr("title");
- attr("<name>","<value>")
- Used to get and set the value of an attribute from first one in the matched set of attributes
- Example:- $("#myimage").attr("src", "mypic.jpg");
- removeAttr("<name>")
- Used to rome tha attribute with value from the mathced element.
- Example:- $("table").removeAttr("border");
- hasClass("<className>")
- It checks weather that particular element has that class or not and returns boolean value.ie., True/False
- Example:-var val = $("div#id1").hasClass("theme");
- addClass("<className>")
- It is used to add the class name to matched element or control.
- Example:-$("div#id1").addClass("theme");
- removeClass("<className>")
- It is used to remove the class from the matched element or control.
- Example:-$("div#id1").removeClass("theme");
- toggleClass("<className>")
- It is used to add the class name if the matched element has not particular class name. if it already contains it removes that particular class name.
- Example:-$("div#id1").toggleClass("theme");
- html() / html ("<Content>")
- These are used to get or set the content to the matched element.
- Example:-var content = $("div#id1").html();
- $("div#id1").html("content")
- text() / text ("<val>")
- These are used to get or set the combined text the matched element.
- Example:-var content = $("div#id1").text();
- $("div#id2").text("content")
- val() / text ("<val>")
- These are used to get or set the input value of the first matched element.
- Example:-var content = $("div#id1").val();
- $("div#id2").val("content")
Example:
In few days.







I was actually looking for this resource a few weeks back. Thanks for sharing with us your wisdom.This will absolutely going to help me in my projects .
Once again great post. You seem to have a good understanding of these themes.When I entering your blog,I felt this . Come on and keep writting your blog will be more attractive. To Your Success!
Classic Dresses
Classic Bridesmaid Dresses
Trumpet Wedding Dresses
New Style Flower Girl Dresses
Wedding Dresses with Sleeves