Home > Web Front-end > JS Tutorial > JS implementation returns the selected text based on the current text selection_javascript skills

JS implementation returns the selected text based on the current text selection_javascript skills

WBOY
Release: 2016-05-16 16:47:26
Original
1264 people have browsed it
Copy code The code is as follows:

<script> <br>function doit(){ <br> newT=document.selection.createRange() <br>clipboardData.setData("Text",newT.text) <br>if(clipboardData.getData("Text")!=null){ <br>document.all.pp .value=clipboardData.getData("Text") <br>} <br>} <br></script>

Add request may occur Change
Expert recommendation and add sorting





test what



Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template