Đang chuẩn bị liên kết để tải về tài liệu:
JavaScript Bible, Gold Edition part 164
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
JavaScript Bible, Gold Edition part 164. 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-122 Part VI Appendixes non-childbearing ones such as HR and INPUT are affected by the color change. But if you reset the page and click the largest button only those elements that can contain nested elements receive the color change. Listing 15-2 Reading the canHaveChildren Property HTML HEAD TITLE canHaveChildren Property TITLE SCRIPT LANGUAGE JavaScript function colorAll for var i 0 i document.all.length i document.all i .style.color red function colorChildBearing for var i 0 i document.all.length i if document.all i .canHaveChildren document.all i .style.color red SCRIPT HEAD BODY H1 canHaveChildren Property Lab H1 HR FORM NAME input INPUT TYPE button VALUE Color All Elements onClick colorAll BR INPUT TYPE button VALUE Reset onClick history.go 0 BR INPUT TYPE button VALUE Color Only Elements That Can Have Children onClick colorChildBearing FORM BR HR FORM NAME output INPUT TYPE checkbox CHECKED Your basic checkbox P P INPUT TYPE text NAME access2 VALUE Some textbox text. P P FORM TABLE ID myTable CELLPADDING 10 BORDER 2 TR TH Quantity TH Description TH Price TR e emenfOb ecf.canHaveChildren Appendix F Examples from Parts III and IV CD-123 TBODY TR TD WIDTH 100 4 TD Primary Widget TD 14.96 TR TR TD 10 TD Secondary Widget TD 114.96 TR TBODY TABLE BODY HTML canHaveHTML NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 IE5.5 Compatibility Example Use The Evaluator Chapter 13 to experiment with the canHaveHTML property. Enter the following statements into the top text field and observe the results document.all.input.canHaveHTML document.all.myP.canHaveHTML The first statement returns false because an INPUT element the top text field in this case cannot have nested HTML. But the myP element is a P element that gladly accepts HTML content. childNodes NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 IE5.5 Compatibility Example The walkChildNodes function shown in Listing 15-3 accumulates and returns a hierarchical list of child nodes from the point of view of the document s HTML element e