jQuery toggleClass()

The jQuery toggleClass() method adds or removes one or more classes of the selected element. If the class name is already added, toggleclass() method removes it and if the class name was removed earlier, it adds the class name, creating a toggle effect. Syntax: $(selector).toggleClass(classname,function(index,currentclass),switch) Classname: Classname is a compulsory parameter of the jQuery toggleClass() … Read more

jQuery hasClass()

The jQuery hasClass() method checks whether the selected elements have specified class names or not. Return Value: TRUE:  If the specified class is present in any of the selected elements. FALSE. If the specified class is not present in any of the selected elements. Syntax: $(selector).hasClass(classname) Classname: Classname is a compulsory parameter of the jQuery … Read more

jQuery addClass()

The jQuery addClass() method adds one or more class names to the selected element. Syntax: $(selector).addClass(classname,function(index,oldclass)) Classname: Classname is a compulsory parameter of the jQuery addClass() method, as it specifies the class names to be added. Function: It is an optional parameter. The function parameter is used to return the property’s class names to be … Read more

jQuery offset()

The jQuery offset() method sets or returns the offset coordinates of the selected elements. Syntax: When used to return the offset coordinates. $(selector).offset() When used to set the offset coordinates. $(selector).offset({top:value,left:value}) When used to set the offset coordinates using a function. $(selector).offset(function(index,currentoffset)) {top:value,left:value}: It is a mandatory parameter that specifies the top and left coordinates … Read more

jQuery prop()

The jQuery prop() method sets or returns attributes or values of the selected elements. Syntax: When used to return the property’s value: $(selector).prop(property) When used to set the property and value: $(selector).prop(property,value) When used to set the property and value by using a function: $(selector).prop(property,function(index,currentvalue)) When used to set multiple properties and values: $(selector).prop({property:value, property:value,…}) … Read more

jQuery attr()

The jQuery attr() method sets or returns the value of a property of selected elements. Syntax: When used to return an attribute’s value: $(selector).attr(attribute) When used to set an attribute and value: $(selector).attr(attribute,value) When used to set an attribute and value by using a function: $(selector).attr(attribute,function(index,currentvalue)) When used to set multiple attributes and values: $(selector).attr({attribute:value, … Read more

jQuery detach()

The jQuery remove() method removes the elements as well as its data and events. While the jQuery empty() method removes only the content from the selected elements. The jQuery detach() method is also used to serve the purpose of removal. The feature that makes this method unique from the rest two is that, this method … Read more

Unix vs Linux

As Linux is an open source and free operating system, it is in great demand. It is everywhere, on our servers, laptops, smart phones, desktops, refrigerators, washing machines etc. People often get mistaken and thinks that UNIX and Linux are the same, but no they are not the same. Many OS were developed to be … Read more