DEV Community

hjqueeen
hjqueeen

Posted on

jQuery

learn : jQuery

jQuery Selectors

element Selector // $("p")
id Selector // $("#test")
class Selector // $(".test")

$("p")
$("#test")
$(".test")
Enter fullscreen mode Exit fullscreen mode

jQuery Event Methods

Mouse Events
click
dblclick // double-clicks
mouseenter // mouse pointer enters
mouseleave // mouse pointer leaves
hover // mouseenter() + mouseleave()
Keyboard Events
keypress
keydown
keyup
Form Events
submit
change
focus
blur // loses focus
Document/Window Events
load
resize
scroll
unload

on() // for one or more event handlers

$("p").on("click", function(){
  $(this).hide();
});
Enter fullscreen mode Exit fullscreen mode
$("p").on({
  mouseenter: function(){
    $(this).css("background-color", "lightgray");
  },
  mouseleave: function(){
    $(this).css("background-color", "lightblue");
  },
  click: function(){
    $(this).css("background-color", "yellow");
  }
});
Enter fullscreen mode Exit fullscreen mode

$(document).ready() // The $(document).ready() method allows us to execute a function when the document is fully loaded.

jQuery Effects

jQuery Hide/Show
jQuery Fade
jQuery Slide
jQuery Animate
jQuery stop()
jQuery Callback
jQuery Chaining

jQuery HTML

jQuery Get
jQuery Set
jQuery Add
jQuery Remove
jQuery CSS Classes
jQuery css()
jQuery Dimensions

jQuery Traversing

jQuery Traversing
jQuery Ancestors
jQuery Descendants
jQuery Siblings
jQuery Filtering

jQuery AJAX

jQuery AJAX Intro
jQuery Load
jQuery Get/Post

jQuery Misc

jQuery noConflict()
jQuery Filters

Top comments (0)