DOM Selection
$ ('. SomeClass ')
Document.queryselector ('. SomeClass ')
Document.queryslectorall ('. SomeClass li ')
DOM manipulation//manipulation manipulation
$element. Remove ()
$element. prepend (otherelement)
$element. Before (otherelement)
$element. addclass (' SomeClass ')
$element. Removeclass (' SomeClass ')
$element. Toggleclass (' SomeClass ')
Const PARENT = $element. Parent ()
Const CLONED = $element. Clone ()
Vanilla://Normal
Element.remove ()
Element.prepend (otherelement)
Element.before (otherelement)
Element.classList.add (' SomeClass ')
Element.classList.remove (' SomeClass ')
Element.classList.toggle (' SomeClass ')
Element.classList.toggle (' SomeClass ')
Const PARENT = Element.parentnode
Const COLINED = Element.clonenode (True)
Element.prepend (Other)
Events
$someElement. On (' click ', Function (e) {
Logic
});
Someelement.addeventlistener (' click '. e=>{
Logic
});
HTTP Requests/ajax
JQuery is MUCH easier than using the XHR object to make Ajax calls. Now we have the Fetch and other specialized libraries.
Fetch (' http://api.something.com ')
. Then (res = Res.json ())
. Then (data = console.log (data))
Axios.get (' http://api.something.com ')
. Then (res = Console.log (res,data))
Utilities
$.isarray (somevalue) Array.isarray (somevalue)
$.inarray (Item,anarray) Somearray.indexof (item) <-1
$.each (Somearray, (Index,value) =>{}) Somearray.foreach ((Value,index) =>{})
$.map (Somearray, (Value,index) =>{}) Somearray.map ((Value,index) =>{})
$.grep (Somearray, (Value,index) =>{}) Somearray.filter ((Value,index) =>{})
$.parsejson (str) json.parse (str)
Animations
Animation with Vanilla JS was one thing that's MUCH more difficult than with jQuery but there be many other options
· CSS Transitions/keyframes
· Web Animation API
3rd party libraries like Greensock
Not on the future and now.
Is the jquery still relevant in 2018? (jquery has great significance in 2018)