Remote web server - CD-446 Part VI . Appendixes Example Use The
CD-446 Part VI . Appendixes Example Use The Evaluator (Chapter 13) to experiment with the move() method. To see how the method returns just the number of units it moves the pointer, begin by creating a text range and set it to enclose the myP element: a = document.body.createTextRange() a.moveToElementText(myP) Now enter the following statement to collapse and move the range backward by 20 words. a.move( word , -20) Continue to click the Evaluate button and watch the returned value in the Results box. The value shows 20while it can still move backward by 20 words. But eventually the last movement will be some other value closer to zero. And after the range is at the beginning of the BODY element, the range can move no more in that direction, so the result is zero. moveEnd( unit [, count]) moveStart( unit [, count]) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example Use The Evaluator (Chapter 13) to experiment with the moveEnd() and moveStart() methods. Begin by creating a text range and set it to enclose the myEM element: a = document.body.createTextRange() a.moveToElementText(myEM) To help you see how movements of the pointers affect the text enclosed by the range, type a into the bottom text box and view all the properties of the text range. Note especially the htmlText and textproperties. Now enter the following statement to move the end of the range forward by one word. a.moveEnd( word ) TextRange.moveEnd()
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.