|  Home   |  About Us   |  Online Exam   |  Tech World   |  Jobs    | Member Login

BACK | NEXT

jQuery Event Functions

   Event functions bind a function to an event for all matching elements.

  Example: $("img").click(function({$("#n10").hide()})

The example code will hide an element with id="n10" when any image is clicked.
          Event function           Binds the function to
    (document).ready(function)     The ready event of a document
(when an HTML document is ready to use)
    (selector).blur(function)     The blur event of matching elements
    (selector).change(function)     The change event of matching elements
    (selector).click(function)     The click event of matching elements
    (selector).dblclick(function)     The double click event of matching elements
    (selector).error(function)     The error event of matching elements
    (selector).focus(function)     The focus event of matching elements
    (selector).keydown(function)     The key down event of matching elements
    (selector).keypress(function)     The key press event of matching elements
    (selector).keyup(function)     The key up event of matching elements
    (selector).load(function)     The load event of matching elements
    (selector).mousedown(function)     The mouse down event of matching elements
    (selector).mouseenter(function)     The mouse enter event of matching elements
    (selector).mouseleave(function)     The mouse leave event of matching elements
    (selector).mousemove(function)     The mouse move event of matching elements
    (selector).mouseout(function)     The mouse out event of matching elements
    (selector).mouseover(function)     The mouse over event of matching elements
    (selector).mouseup(function)     The mouse up event of matching elements
    (selector).resize(function)     The resize event of matching elements
    (selector).scroll(function)     The scroll event of matching elements
    (selector).select(function)     The select event of matching elements
    (selector).submit(function)     The submit event of matching elements
    (selector).unload(function)     The unload event of matching elements

jQuery HTML Manipulation Functions

These functions work for both XML documents and HTML documents. Exception: html()

           Manipulate            Description
    (selector).html(content)     Set the content (inner HTML) of selected elements
    (selector).text(text)     same as html(), but tags will be escaped

Getting Contents

    (selector).html() Get the contents (inner HTML) of the first selected element
    (selector).text() Get the text content of all selected elements (combined)

Adding Content

    (selector).after(content)     Add content after selected elements
    (selector).before(content)     Add content before selected elements
    (selector).insertAfter(selector) Add selected elements after selected elements
    (selector).insertBefore(selector) Add selected elements before selected elements

Adding Inner Content

    (selector).append(content) Append content to the inner content of selected elements
    (selector).prepend(content) "Prepend" content to the inner content of selected elements
    (selector).appendTo(selector) Append selected elements to the inner content of selected elements
    (selector).prependTo(selector) "Prepend" selected elements to the inner content of selected elements

Wrapping

    (selector).wrap(content) Wrap selected elements within a content
    (selector).wrapAll(content) Wrap selected elements into one content
    (selector).wrap(element) Wrap selected elements inside a new DOM element
    (selector).wrapAll(element) Wrap selected elements into one new DOM element
    (selector).wrapinner(content) Wrap selected inner child contents within a content
    (selector).wrapinner(element) Wrap selected inner child contents within a DOM element

Copy, Replace, Remove

    (selector).replaceAll(selector) Replace selected elements with selected elements
    (selector).replaceWidth(content) Replace selected elements with new content
    (selector).empty() Remove all child elements from selected elements
    (selector).remove() Remove all selected elements
    (selector).clone() Clone all selected elements

jQuery CSS Manipulation Functions

          CSS Properties           Description
(selector).css(name,value) Set the value of one style property for all selected elements
(selector).css({properties}) Set multiple style properties for all selected elements
(selector).css(name) Get the style property value of the first selected element

CSS Size

    (selector).height() Get the pixel height of the first selected element
    (selector).height(value) Set the height of all selected elements
    (selector).width() Get the pixel width of the first selected element
    (selector).width(value) Set the width of all selected elements

CSS Positioning

    (selector).offset() Get the pixel offset of the first selected element
    (selector).offsetParent() Get the parent pixel offset of the first selected element
    (selector).position() Get the top position of the first selected element

CSS Scrolling

    (selector).scrollTop() Get the scroll top offset of the first selected element
    (selector).scrollTop(value) Set the scroll top offset of all selected elements
    (selector).scrollLeft() Get the scroll left offset of the first selected element
    (selector).scrollLeft(value) Set the scroll left offset of all selected elements

NEXT



               Our Portals  :   www.righttimeproperty.com   |   www.sundaychennai.com   |   www.dorabuji.com