1. return text and htmlText of createTextRange
<Input type = "button" onclick = "test ()" value = "text"> <input type = "button" onclick = "test1 ()" value = "htmlText">
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
2. Obtain the selected text in the specified text box: only the first text box is returned.
<Input id = "inp1" type = "text" value = "1234567890"> <input id = "inp2" type = "text" value = "9876543210"> <input type = ""button" onclick = "test () "value =" OK ">
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
3. reverse search of page text
Abababababababa <input value = "reverse lookup a" onclick = myfindtext ("a") type = "button">
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
4. Focus the control and put the cursor at the end
<Input type = "text" value = "http://jb51.net" onfocus = "setFocus ()">
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
5. Obtain the cursor position in the text box.
<Input type = "text" id = "txt1" value = "1234567890"> <input type = "button" value = "Get cursor position" onclick = getPos (txt1)>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
6. Control the cursor position in the input box
<Input type = "text" id = "text1" value = "1234567890"> <select onchange = "setPos (this. selectedIndex) "> <option value =" 0 "> 0 </option> <option value =" 1 "> 1 </option> <option value =" 2 "> 2 </option> <option value = "3"> 3 </option> <option value = "4"> 4 </option> <option value = "5"> 5 </option> <option value = "6"> 6 </option> <option value = "7"> 7 </option> </select>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
7. Select a text section in the text box
<Input type = "text" id = "text1" value = "1234567890"> <select onchange = "sel (text1, this. value) "> <option value =" 0 "> 0 </option> <option value =" 1 "> 1 </option> <option value =" 2 "> 2 </option> <option value = "3"> 3 </option> <option value = "4"> 4 </option> <option value = "5"> 5 </option> <option value = "6"> 6 </option> <option value = "7"> 7 </option> </select>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
8. control the movement of the cursor in the text box
<Input type = "button" value = "<" onclick = go (-1)> <input id = "demo" value = "here is the text"> <input type = "button" value = ">" onclick = go (1)> /[html] 9. Position of the cursor: [html] <body> click textarea <pre class = "code" onclick = doit () rows = "6" cols = "33"> sdfsdfsdfsdfsdfsdf
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
10. Use the mouse to select some fonts. The selected fonts will be automatically pasted in textarea.
<Html> test this. I am skanso. <pre class = "code" name = pp> </textarea> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]