My web site - 159Chapter 15 .Generic HTML Element Objects unless your
Sunday, September 30th, 2007159Chapter 15 .Generic HTML Element Objects unless your scripts immediately assign new attributes to the element, the appearance of the element reverts to its completely unadorned form until you assign new attributes. This means that even positioned elements find their way back to their source code order until you assign a new positioning style. If you simply want to change the value of one or more attributes of an element, it is faster to use the setAttribute() method or adjust the corresponding property. To accomplish a result in NN6 that simulates that of IE5 s clearAttributes(), you must iterate through all attributes of an element and remove those attributes (via the removeAttribute() method) whose names are other than ID and NAME. Example on the CD-ROM Related Items: attributes property; getAttribute(), setAttribute(), removeAttribute(), mergeAttributes(), and setAttributeNode() methods. click() Returns: Nothing. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility The click() method lets a script perform nearly the same action as clicking an element. While this method was available in one form or another since the beginning of scripting, it was available only on INPUT elements that act as buttons (input type button, reset, submit, radio, and checkbox). Most element objects received the method in IE4 and NN6. The behavior of the click()method has also changed over time. Prior to NN4 and IE4, the click() method invoked on a button did not trigger the onClick event handler for the object. This has significant impact if you expect the onClick event handler of a button to function even if a script performs the click. For earlier browser versions, you have to invoke the event handler statements directly. Also, just because a script is clicking a button, not all buttons in all platforms change their appearance in response. For example, NN4 on the Mac does not change the state of a checkbox when clicked remotely. (Win32 versions of version 4 browsers do change state.) If you want to script the action of clicking a button, you can safely invoke the resulting event handler function directly. And if the element is a radio button or checkbox, handle the change of state directly (for example, set the checkedproperty of a checkbox) rather than expect the browser to take care of it for you. Example on the CD-ROM On the CD-ROM On the CD-ROM elementObject.click()
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.