Category «jQuery»

jQuery, HTML, JavaScript, CSS, jQuery UI, BootStrap, jQuery Tips, jQuery training tutorials, programming, quiz, examples, Selectors, Attributes, Traversing, DOM, Events, AJAX

.each() in JQuery

  Description: Iterate over a jQuery object, executing a function for each matched element. version added: 1.0.each( function(index, Element) ) function(index, Element)A function to execute for each matched element. The .each() method is designed to make DOM looping constructs concise and less error-prone. When called it iterates over the DOM elements that are part of …

.get() in JQuery

. Description: Retrieve the DOM elements matched by the jQuery object. version added: 1.0.get( [ index ] ) indexA zero-based integer indicating which element to retrieve. The .get() method grants us access to the DOM nodes underlying each jQuery object. Suppose we had a simple unordered list on the page: <ul> <li id=”foo”>foo</li> <li id=”bar”>bar</li> …

.index() in JQuery

  Description: Search for a given element from among the matched elements. version added: 1.4.index() version added: 1.4.index( selector ) selectorA selector representing a jQuery collection in which to look for an element. version added: 1.0.index( element ) elementThe DOM element or first element within the jQuery object to look for. Return Values If no …

jQuery.param() in JQuery

  Description: Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. version added: 1.2jQuery.param( obj ) objAn array or object to serialize. version added: 1.4jQuery.param( obj, traditional ) objAn array or object to serialize. traditionalA Boolean indicating whether to perform a traditional “shallow” serialization. …

.removeData() in JQuery

  Description: Remove a previously-stored piece of data. version added: 1.2.3.removeData( [ name ] ) nameA string naming the piece of data to delete. The .removeData() method allows us to remove values that were previously set using .data(). When called with the name of a key, .removeData() deletes that particular value; when called with no …

.toArray() in JQuery

  Description: Retrieve all the DOM elements contained in the jQuery set, as an array. version added: 1.4.toArray() .toArray() returns all of the elements in the jQuery set: alert($(‘li’).toArray()); All of the matched DOM nodes are returned by this call, contained in a standard array: [<li id=”foo”>, <li id=”bar”>] Example: Selects all divs in the …

jQuery.noConflict() in JQuery

  Description: Relinquish jQuery’s control of the $ variable. version added: 1.0jQuery.noConflict( [ removeAll ] ) removeAllA Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery’s case, $ is just an alias …

jQuery.noConflict() in JQuery

  Description: Relinquish jQuery’s control of the $ variable. version added: 1.0jQuery.noConflict( [ removeAll ] ) removeAllA Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery’s case, $ is just an alias …

.data() in JQuery

  Description: Store arbitrary data associated with the matched elements. version added: 1.2.3.data( key, value ) keyA string naming the piece of data to set. valueThe new data value. version added: 1.4.data( obj ) objAn object of key-value pairs of data to set. The .data() method allows us to attach data of any type to …

.scrollLeft() in JQuery

  Description: Get the current horizontal position of the scroll bar for the first element in the set of matched elements. version added: 1.2.6.scrollLeft() The horizontal scroll position is the same as the number of pixels that are hidden from view above the scrollable area. If the scroll bar is at the very left, or …