Đang chuẩn bị liên kết để tải về tài liệu:
jQuery in Action phần 4

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Tham khảo tài liệu 'jquery in action phần 4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Manipulating element properties and attributes 51 For the most part the name of a JavaScript attribute property matches that of any corresponding attribute but there are some cases where they differ. For example the class attribute in this example is represented by the className attribute property. jQuery gives us the means to easily manipulate an element s attributes and gives us access to the element so that we can also change its properties. Which of these we choose to manipulate depends on what we want to do and how we want to do it. Let s start by looking at getting and setting element properties. 3.1.1 Manipulating element properties jQuery doesn t possess a specific command to obtain or modify the properties of elements. Rather we use the native JavaScript notation to access the properties and their values. The trick is in getting to the element references in the first place. The easiest way to inspect or modify the component elements of a matched set is with the each command. The syntax of this command is as follows Command syntax each each iterator Traverses all elements in the matched set invoking the passed iterator function for each. Parameters iterator Function A function called for each element in the matched set. The parameter passed to this function is set to the zero-based index of the element within the set and the element itself is available as the this property of the function. Returns The wrapped set. This command can be used to easily set a property value onto all elements in a matched set. For example consider img .each function n this.alt This is image n with an id of this.id This statement will invoke the inline function for each image element on the page modifying its alt property using the order of the element and its id value. Note that because this is an attribute property tied to an attribute of the same name the alt attribute is also indirectly updated. 52 CHAPTER 3 Bringing pages to life with jQuery Similarly we can collect all .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.