Category: 2. JQUERY Referance

  • Event Handler Attachment

    Method Description bind() Bind an event handler to be fired when the given type of event is sent to the element. In general, use the on() method instead. delegate() Bind one or more event handlers to be fired when the given type of event is/are sent to a descendant element matching selector. jQuery.proxy() Takes an existing function…

  • Document/Browser Events

    Method Description error() Deprecated in v1.8 Bind an event handler to be fired if the element was not loaded correctly. load() Deprecated in v1.8 Bind an event handler to be fired when the element finishes loading. Deprecated in favor of Ajax load() method. ready() Bind an event handler to be fired when the DOM is fully loaded. resize() Bind…

  • Form Events

    Method Description blur() Bind an event handler to be fired when the element loses keyboard focus, or trigger that event on an element. change() Bind an event handler to be fired when the element’s value changes, or trigger that event on an element. focus() Bind an event handler to be fired when the element gains…

  • Keyboard Events

    Method Description keydown() Bind an event handler to be fired when a key is pressed and the element has keyboard focus, or trigger that event on an element. keypress() Bind an event handler to be fired when a keystroke occurs and the element has keyboard focus, or trigger that event on an element. keyup() Bind…

  • jQuery Event Methods

    jQuery Event MethodsOrder by Alphabet This section contains a comprehensive list of event methods belonging to the latest jQuery JavaScript library. All the methods are grouped into categories. Mouse Events Method Description click() Bind an event handler to be fired when the element is clicked, or trigger that handler on an element. dblclick() Bind an…

  • Visibility Filter Selectors

    Selector Example Description :hidden $(“p:hidden”) Selects all <p> elements that are hidden. :visible $(“p:visible”) Selects all <p> elements that are visible.

  • Hierarchy Selectors

    Selector Example Description parent > child $(“ul > li”) Selects all <li> elements that are direct child of their parent <ul> element. ancestor descendant $(“form label”) Selects all <label> elements that are descendant of their ancestor <form> element. prev + next $(“h1 + p”) Selects all <p> elements that are next i.e. immediately preceded to the <h1> elements. prev ~ siblings $(“h1 ~ p”) Selects all <p> elements that are…

  • Attribute Selectors

    Selector Example Description [attribute] $(“[href]”) Selects all elements with a href attribute, with any value. [attribute=”value”] $(‘a[target=”_blank”]’) Selects all <a> elements that have the target attribute with a value equal to “_blank”. [attribute=”value”] $(‘a[target!=”_blank”]’) Selects all <a> elements that don’t have the target attribute, or if have don’t with a value “_blank”. [attribute$=”value”] $(‘img[src$=”.png”]’) Selects all <img> elements that have the src attribute with a value ending with “.png”. [attribute|=”value”] $(‘a[hreflang|=”en”]’) Selects…

  • Form Selectors

    Selector Example Description :input $(“:input”) Selects all input, textarea, select and button elements (basically selects all form controls). :text $(“:text”) Selects all input elements with type=”text”. :password $(“:password”) Selects all input elements with type=”password”. :radio $(“:radio”) Selects all input elements with type=”radio”. :checkbox $(“:checkbox”) Selects all input elements with type=”checkbox”. :button $(“:button”) Selects all input and button elements with type=”button”.…

  • Content Filter Selectors

    Selector Example Description :contains() $(‘p:contains(“Hello”)’) Selects all <p> elements that contains the text “Hello”. :empty $(“td:empty”) Selects all <td> elements that are empty i.e that have no children including text. :has() $(“p:has(img)”) Selects all <p> elements which contain at least one <img> element. :parent $(“:parent”) Select all elements that have at least one child node either an element or text.