The jQuery val() method get the current value of the first element in the set of matched elements or set the value of every matched element. .val() Description : Get the current value of the first element in the set of matched elements. Source Code Demo Following example find the value of an input box. [...]
jQuery toggleClass() method
The jQuery addClass() method add or remove one or more classes from each element in the set of matched elements, depending on either the class’s presence or the value of the switch argument. Source Code Demo Following example toggle the class ‘highlight’ class on div (with class=”div1″) when button is clicked. Div 1 Div 2 [...]
jQuery removeProp() method
The jQuery removeClass() method remove a property for the set of matched elements. Source Code Demo Following example remove the “checked” property of the checkbox (with id=”check1″). Checkbox Click Here
jQuery removeClass() method
The jQuery removeClass() method remove a single class, multiple classes, or all classes from each element in the set of matched elements. Source Code Demo Following example remove the “highlight” class from the div that contains ‘div1′ class. Div 1 Div 2 Click Here
jQuery removeAttr() method
The jQuery removeAttr() method remove an attribute from each element in the set of matched elements. Source Code Demo Following example removes the “title” attribute from div1 (having div1 class1) and adds highlight class on it. Div 1 Div 2 Get Attribute Value
jQuery prop() method
The jQuery prop() method get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element. .prop( propertyName ) Description : Get the value of a property for the first element in the set of matched elements. Source Code Demo Following [...]
jQuery html() method
The jQuery html() method get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element. .html() Description : Get the HTML contents of the first element in the set of matched elements. Source Code Demo Following example get the HTML content of the [...]
jQuery hasClass() method
The jQuery hasClass() method checks whether any of the matched elements are assigned the given class. Source Code Demo Following example find the div that contains ‘div1′ class. Div 1 Div 2 Click Here
jQuery attr() method
The jQuery attr() method get the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element. .attr( attributeName ) Description : Get the value of an attribute for the first element in the set of matched elements. Source Code Demo Following [...]
jQuery addClass() method
The jQuery addClass() method adds the specified class(es) to each of the set of matched elements. Source Code Demo Following example finds the element with the class “div1″ and adds highlight class on it. Div 1 Div 2 Click Here
