Friday 9 August 2013

What is the Diference Difference Between Document.ready and Window.onload

The main difference is that document.ready() event gets called as soon as your DOM is loaded. It does not wait for the contents to get loaded fully, while window.onload will wait until all your contents are loaded fully
We can have more than one document.ready() function in a page where we can have only one onload function.

What is JQuery Connect

This is a jQuery plugin that is used to connect / bind a function to another function.Connect is used to execute a function whenever a function from another object or plugin is executed

What is a Selector and What Are Different Selectors Available in Jquery

jQuery selectors allow you to select and manipulate HTML elements as a group or as a single element. Selectors allow you to get the exact element/attribute you want from your HTML document

Tuesday 6 August 2013

How to Select Last Child of the Parent Element? – Last Child Selector

To select last child of the parent element last child selector can be used. Example is shown below
$(’#div p:last-child’)
This lets you access the last P tag element present in container with id ‘div’

How to Select Multiple Elements at a Time? Multiple Selector

To select multiple elements having different attributes, multiple selector can be used. We can mix the class selector, element selector, id selector in this selector separated by “,”
$(’p.class, #p1′)
This will let you select all paragraph (p) having class attribute set as ‘class’ and all html elements having id attribute as ‘p1′