Home » JavaScript (page 20)

JavaScript

jQuery appendTo Example

The aim of this example is to explain and use jQuery’s .appendTo() method. What this method does, basically, is insert every element in the set of matched elements to the end of the target. This method is the opposite of .prependTo() which inserts HTML elements at the beginning of the selected elements. This method is used to dynamically insert content ...

Read More »

The Top 10 Lessons Learned from Enterprise JavaScript Development

A week ago I presented a talk at Atlanta’s ConnectJS conference. The title of the talk was “The Top 10 Lessons Learned in Enterprise JavaScript.” Because it was a JavaScript-focused talk I decided to author the presentation in JavaScript using one of Google’s Html5 projects. You can view The Top 10 Lessons from Enterprise JavaScript Development and also browse the ...

Read More »

jQuery Selector Example

The aim of this example is to go through some of the most important and used jQuery selectors widely used over websites to achieve specific results depending on the case. Selectors can be considered as identifiers for jQuery to match what is written in the quotes with what is actually part of the document, and not necessarily what we write ...

Read More »

jQuery Val Example

The aim of this example is to explain and use the .val() method of jQuery. This method Gets the current value of the first element in the set of matched elements or sets the value of every matched element. In other words, the method returns or sets the value attribute of the selected elements. The .val() method is primarily used ...

Read More »

jQuery Prepend Example

The aim of this example is to explain and use the .prepend() method of jQuery. This method will allow you to insert content, specified by the parameter, to the beginning of each element in the set of matched elements. It is similar to the .append() method, except that the .append() method inserts content at the end of the selected elements. ...

Read More »

jQuery Filter Example

The aim of this example is to have a look at the .fiter(); method of jQuery. What this method does is reduce the set of matched elements to those that match the selector or pass the function’s test. In other words, the filter() method returns elements that match a certain criteria. It lets you specify a criteria. Elements that do ...

Read More »

jQuery Fadeout Example

In this example, the aim is to explain and use the .fadeOut() jQuery method. The fadeOut() method gradually changes the opacity, for selected elements, from visible to hidden (fading effect). If you’ve used this method previously, you probably know it is just the opposite of the .fadeIn() method. It hides the matched elements by fading them to transparent. It comes ...

Read More »

jQuery slideToggle / slideUp / slideDown Example

In this example, we’ll be considering three popular jQuery methods .slideUp, .slideDown, .slideToggle. For your basic understanding, know that slideUp hides the matched elements with a sliding motion, slideDown displays the matched elements with a sliding motion, while slideToggle will toggle between the two states, meaning it will display or hide the matched elements with a sliding motion. The methods ...

Read More »

jQuery Find Example

In this example we’re going to talk about the .find() method of jQuery. What this method does is kind of self-explanatory, it gets the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. A descendant is a child, grandchild, great-grandchild, and so on. It has only one argument, which is ...

Read More »