270Part IIIDocument Objects ReferenceListing 15-22(continued) function applyOutside() { (Web hosting mysql)

270Part IIIDocument Objects ReferenceListing 15-22(continued)

applyElement() Method



A simple paragraph with a special word in it.


The visible results of applying the emelement inside and outside the spanelement in thiscase are the same. But you can see from the HTML results that each element impacts the ele- ment hierarchy quite differently. Related Items:insertBefore(), appendChild(), insertAdjacentElement()methods. attachEvent( eventName , functionRef) detachEvent( eventName , functionRef) Returns:Boolean. Compatibility:WinIE5+, MacIE-, NN-, Moz-, Safari- The attachEvent()method is used primarily within code that specifies IE behaviors (seeChapter 48 on the CD-ROM). But you can also use it in regular scripting as yet another way tobind an event handler to an object. The following example characterizes the more typicalapproach to assigning an event handler: myObject.onmousedown = setHilite; elementObject.applyElement()