tailieunhanh - JavaScript Bible, Gold Edition part 72
JavaScript Bible, Gold Edition part 72. 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. | 558 Part III Document Objects Reference On h Example with Listing 24-3 on the CD-ROM Related Items checked value properties. type Value String checkbox Read-Only NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Use the type property to help you identify a checkbox object from an unknown group of form elements. Related Items property. value Value String Read Write NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility A checkbox object s value property is a string of any text that you want to associate with the box. Note that the checkbox s value property is not the label as it is for a regular button but hidden text associated with the checkbox. For instance the label that you attach to a checkbox may not be worded in a way that is useful to your script. But if you place that useful wording in the VALUE attribute of the checkbox tag you can extract that string via the value property. When a checkbox object s data is submitted to a CGI program the value property is sent as part of the name value pair if the box is checked nothing about the checkbox is sent if the box is unchecked . If you omit the VALUE attribute in your definition the property always yields the string on which is submitted to a CGI program when the box is checked. From the JavaScript side don t confuse this string with the on and off settings of the checkbox Use the checked property to determine a checkbox s status. On h Example with Listing 24-4 on the CD-ROM Related Items checked property. Chapter 24 Button Objects 559 Methods click Returns Nothing. NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility The intention of the click method is to enact via script the physical act of clicking a checkbox but without triggering the onClick event handler . Unfortunately this method does not work in Navigator 2 or 3 as expected. Even if this method worked flawlessly your scripts are better served by setting the checked property so that
đang nạp các trang xem trước