Tag Archives | jquery

jQuery val() method

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. [...]

Continue Reading ... Comments { 0 }

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 [...]

Continue Reading ... Comments { 0 }

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

Continue Reading ... Comments { 0 }

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

Continue Reading ... Comments { 0 }

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

Continue Reading ... Comments { 0 }

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 [...]

Continue Reading ... Comments { 0 }

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 [...]

Continue Reading ... Comments { 0 }

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

Continue Reading ... Comments { 0 }

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 [...]

Continue Reading ... Comments { 0 }

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

Continue Reading ... Comments { 0 }