Sample Code for TextRange operations such as cursor Positioning

Source: Internet
Author: User
Tags microsoft frontpage

<Html> <pead> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> <meta name =" GENERATOR "content =" Microsoft FrontPage 4.0 "> <meta name =" ProgId "content =" FrontPage. editor. document "> <title> cursor position </title> <style> INPUT {border: 1 solid #000000} BODY, TABLE {font-size: 10pt }</style> </pead> <body> <table border = "0" width = "700" cellspacing = "0" cellpadding = "0"> <tr> <td width = "479" rowspan = "7"> click TextArea to position the cursor <p> <pre class = "code" rows = "7" cols = "49" id =" box "onclick = tellPoint ()> I am afraid that I will hold you too late, until I feel that your crepe has traces of time, until the line of sight becomes blurred until I cannot breathe for you, I want to move and want to watch you, until you feel that your hair has traces of snow, until you are sure that you are true, until you lose strength makes us inseparable, if the world can also give up, at least you deserve to be cherished, and here you are the miracle of life. Maybe I can forget it all over the world, I don't want to lose your message. Your palm moles. I always remember where we are. We can't help it. I'm afraid that the time is too short to take you into consideration, I am afraid that the time is too slow, day and night, and you may wish to never separate your white heads overnight. </textarea> </p> cursor position: <input type = "text" value = "0" id = "pnum" size = "8"> <input type = "button" onclick = "movePoint () "value =" move the cursor to the specified position "> <p> </p> select the specified range: <input type = "text" size = "9" id = "sbox"> -- <input type = "text" size = "9" id = "ebox"> <input type = "button" onclick = "selectText (sbox. value, ebox. value) "value =" select "> <p> </p> select the search character: <input type = "text" value = "" id = "cbox" size = "8"> <input type = "button" onclick = "findText (cbox. value) "value =" find the next one and select "> </td> <td width =" 217 "> boundingHeight: </td> </tr> <td width = "217"> boundingWidth: </td> </tr> <td width = "217"> boundingTop: </td> </tr> <td width = "217"> boundingLeft: </td> </tr> <td width = "217"> offsetLeft: </td> </tr> <td width = "217"> offsetTop: </td> </tr> <td width = "217"> text: </td> </tr> </table> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.