Home >Web Front-end >JS Tutorial >Some usage examples of js createRange and createTextRange_javascript skills

Some usage examples of js createRange and createTextRange_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:26:121593browse

1. Return the text and htmlText of createTextRange


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]


2. Obtain Specify the selected text in the text box: only respond to the first text box

[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]

3. Page Text search in reverse order abababababababa
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]


[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]



[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]
6 7



[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute 5
6 7
[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute ]

八、控制文本框内光标的移动

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

十、用鼠标选择部分字体,选择的字体就自动粘贴在textarea中

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn