TAILIEUCHUNG - JavaScript Bible, Gold Edition part 200

JavaScript Bible, Gold Edition part 200. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | CD-482 Part VI Appendixes Checkbox Input Object Properties checked NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example The simple example in Listing 24-2 passes a form object reference to the JavaScript function. The function in turn reads the checked value of the form s checkbox object and uses its Boolean value as the test result for the i construction. Listing 24-2 The checked Property as a Conditional HTML HEAD TITLE Checkbox Inspector TITLE SCRIPT LANGUAGE JavaScript function inspectBox form if alertCThe box is checked. else alertCThe box is not checked at the moment. SCRIPT HEAD BODY FORM INPUT TYPE checkbox NAME checkThis Check here P INPUT TYPE button NAME boxChecker VALUE Inspect Box onClick inspectBox FORM BODY HTML Appendix F Examples from Parts III and IV CD-483 defaultChecked NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example The function in Listing 24-3 this fragment is not in the CD-ROM listings is designed to compare the current setting of a checkbox against its default value. The if construction compares the current status of the box against its default status. Both are Boolean values so they can be compared against each other. If the current and default settings don t match the function goes on to handle the case in which the current setting is other than the default. Listing 24-3 Examining the defaultChecked Property function compareBrowser thisBox if statements about using a different set of HTML pages value NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example The scenario for the skeleton HTML page in Listing 24-4 is a form with a checkbox whose selection determines which of two actions to follow for submission to the server. After the user clicks the Submit button a JavaScript function examines the checkbox s checked property. If the property is true the button is

TỪ KHÓA LIÊN QUAN
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.