TAILIEUCHUNG - JavaScript Bible, Gold Edition part 55

JavaScript Bible, Gold Edition part 55. 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. | 388 Part III Document Objects Reference Table 18-4 continued Command Parameter Description SelectAll None Selects all text of the document. UnBookmark None Removes anchor tags that surround the current selection. Unlink None Removes link tags that surround the current selection. Unselect None Deselects the current selection anywhere in the document. Example on the CD Related Items queryCommandEnabled queryCommandIndterm queryCommandState queryCommandSupported queryCommandText queryCommandValue methods. getElementByldC elementID Returns Element object reference. NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility The method is the W3C DOM syntax for retrieving a reference to any element in a document that has a unique identifier assigned to its ID attribute. If the document contains more than one instance of an ID the method returns a reference to the first element in source code order with that ID. Because this method is such an important avenue to writing references to objects that are to be modified under script control you can see how important it is to assign unique IDs to elements. This method s name is quite a finger twister for scripters especially compared to the IE4 convention of letting a reference to any element begin simply with the object s ID. But unless you utilize the normalization trick for NN6 as described in Chapter 15 the getElementById method is the cross-browser way of gaining an element s reference for IE5 and NN6 . When you type this method be sure to use a lowercase d as the last character of the method name. Unlike some other element-oriented methods for example getElementsByTagName which can be invoked on any element in a document the getElementById method works exclusively with the document object. Chapter 18 The Document and Body Objects 389 On the Example on the CD CD-ROM r Related Items getElementsByTagName method Chapter 15 . getElementsByNameC elementName Returns .

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