tailieunhanh - JavaScript Bible, Gold Edition part 164

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 i i . red function colorChildBearing for var i 0 i i if i .canHaveChildren i . 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 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 Appendix F Examples from Parts III and IV CD-123 TBODY TR TD WIDTH 100 4 TD Primary Widget TD TR TR TD 10 TD Secondary Widget TD TR TBODY TABLE BODY HTML canHaveHTML NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 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 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 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

TỪ KHÓA LIÊN QUAN