0.1.0
Selects all elements with given selector.
((string | HTMLElement))
$("*") // Select all elements in document
$(".class") // Selects all elements with the given class.
$("#id") // Selects a element with the given id.
$("[name=”value”]") // Selects elements that have the specified attribute with a value exactly equal to a certain value.
$("[name]") // Selects elements that have the specified attribute, with any value.
$(".class:eq(index)") // Select the element at index n within the matched set.
$(".class:gt(index)") // Select all elements at an index greater than index within the matched set.
$(".class:lt(index)") // Select all elements at an index less than index within the matched set.
$(".class:odd") // Selects odd elements, zero-indexed.
$(".class:even") // Selects even elements, zero-indexed.
Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. Selector can be use same as selectors
((string | HTMLElement))
any
:
$
$(".class").find(selector)
Get the index of the first element in the set of matched elements.
((HTMLElement | $))
$
:
$(".class").push(element) // Add an element to the current set of matched elements.
$(".class").push($(".class")) // Add elements as Jquery ($) object to the current set of matched elements.
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 state argument.
(string)
(any)
($ | string)
:
$(".class").prop(prop) // Get the value of a property for the first element in the set of matched elements.
$(".class").prop(prop, val) // Set a property for the set of matched elements.
(string)
(any)
($ | string)
:
$(".class").data(key, val) // Store arbitrary data associated with the matched elements.
$(".class").data(attr) // Return arbitrary data associated with the first element in the jQuery collection, as set by data() or by an HTML5 data-* attribute.
$(".class").data() // Return all the data stores of the first element in the set of matched elements.
($ | string | $)
:
$(".class").css(key, value) // Set the computed style properties for all elements in the set of matched elements.
$(".class").css(key) // Get the computed style properties for the first element in the set of matched elements.
$(".class").css({
propertyName1:propertyValue1,
propertyName2:propertyValue2
}) // Set the computed style properties for all elements in the set of matched elements.
(HTMLElement)
$
:
$(".class").append(element) // Insert content, specified by the parameter, to the end of each element in the set of matched elements.
(HTMLElement)
$
:
$(".class").appendTo(element) // Insert every element in the set of matched elements to the end of the target.
(HTMLElement)
$
:
$(".class").after(element) // Insert content, specified by the parameter, after each element in the set of matched elements.
(HTMLElement)
$
:
$(".class").before(element) // Insert content, specified by the parameter, before each element in the set of matched elements.
(HTMLElement)
$
:
$(".class").prepend(element) // Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
HTMLElement
:
$(".class").clone() // Create a deep copy of the set of matched elements.
((string | HTMLElement))
$
:
$(".class").children(selector) // Get the children of each element filtered by given selector in the set of matched elements.
$(".class").children() // Get the children of each element in the set of matched elements.
((string | HTMLElement))
$
:
$(".class").parents(selector) // Get the ancestors of each element filtered by given selector in the current set of matched elements.
$(".class").parents() // Get the ancestors of each element in the current set of matched elements.
((string | HTMLElement))
$
:
$(".class").siblings(selector) // Get the siblings of each element filtered by given selector in the set of matched elements.
$(".class").siblings() // Get the siblings of each element in the set of matched elements.
((string | HTMLElement))
$
:
$(".class").parent(selector) // Get the parent of each element filtered by given selector in the current set of matched elements.
$(".class").parent() // Get the parent of each element in the current set of matched elements.
((string | HTMLElement))
$
:
$(".class").closest(selector) // For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
An ajax request can be created by using following codes.
(object)
Promise
:
example of options
{
url: URL,
type: 'POST', // POST or GET
processData: false,
contentType: false,
data: formData,
headers: { "X-CSRF-TOKEN": $('meta[name="_token"]').attr('content') },
success: function(response){
console.log(response);
},
error: function(error){
console.log(error);
}
}
example of options
{
url: URL,
type: 'POST', // POST or GET
processData: false,
contentType: false,
data: formData,
headers: { "X-CSRF-TOKEN": $('meta[name="_token"]').attr('content') },
}
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
$.ajax(time, options)