tailieunhanh - Dojo Using the Dojo JavaScript Library to Build Ajax Applications phần 10
Bằng cách này, chúng tôi đề cập đến những thứ xảy ra khi "sự kiện." phản ứng của chúng tôi với các sự kiện không thể thụ động. Các trang của chúng tôi phải làm những việc để xử lý các sự kiện. Các sự kiện và xử lý sự kiện và làm thế nào Dojo có thể giúp các chủ đề của chương này. | 282 Chapter 16 Working with the DOM Table Continued Pattern Meaning Type of Selector E foo warning Matches any E element whose foo attribute value is exactly equal to warning. Attribute selectors E foo warning Matches any E element whose foo attribute value is a list of space-separated values one of which is exactly equal to warning. Attribute selectors E lang en Matches any E element whose lang attribute has a hyphen-separated list of values beginning from the left with en. Attribute selectors HTML only. The same as DIV class warning . Class selectors E myid Matches any E element id equal to myid. ID selectors Dojo also provides support for the CSS 3 Specification that includes some additional selector types that are beyond the scope of this discussion. Again more information can be found in the Using Selectors in The technique for using a selector to find a set of DOM elements using Dojo is straightforward. Just pass the selector as a string to the function. For example to find all the h1 elements use the following code. elementList h1 More complex selectors require a more complex selector string but the syntax for getting the elements is still the same. To find all the paragraph elements that are descendents of a div element use the code shown here elementList div p And the syntax doesn t get any more complicated although the selector strings do Here s another one uses the class attribute selector just described to find all the elements that are associated with the class plainText. elementList .plainText The function is part of base means that you don t need to include a statement to bring the function into your page. Just call the function from your code. 2. The CSS 3 Specification can be viewed at the following link http TR 2001 CR-css3-selectors-20011113 . Animation 283 Using DOM Elements Found by
đang nạp các trang xem trước