Explain jQuery Events

Another one of jQuery’s strengths is the API it provides for subscribing to events in the DOM. Although you can use a generic bind function to capture any event using an event name specified as a string, jQuery also provides dedicated methods for common events, such as click, blur, and submit. As demonstrated earlier, you tell jQuery what to do when the event occurs by passing in a function. The function can be anonymous, as in the example you saw in the section “The jQuery Function” earlier in the chapter, or you can also pass a named function as an … Click here to continue…..

Explain jQuery Selectors

Selectors are the strings you pass to the jQuery function to select elements in the DOM. Example:

In this example, we used “#album-list img” as a selector to find image tags. If you think the string looks like something you might use in a cascading style sheet (CSS), you would be correct. The jQuery selector syntax derives from CSS 3.0 selectors, with some additions. Table 8-1 lists some of the selectors you’ll see in everyday jQuery code. Here are some examples of Common Selectors: Example Meaning $(“#header”) Find the element with an id of “header” $(“.editor-label”) Find all elements … Click here to continue…..

Check All Checkbox of a grid by using JavaScript

Modal window in javascript.

Here is a syntax that how you can use modal dialog window in any web page. There are 2 types of popup windows: window.open ModalDialog In both of then there are only one difference i.e. in ModalDialog you can’t focus on parent browser page without closing this pop-up window but in window.open you can focus on parent window any time.