Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Javascript Copy Function
建立於
6 年前
差異永不過期
清除
匯出
分享
解釋
2 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
15 行
全部複製
1 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
15 行
全部複製
<body>
<body>
<h2 id="title">Copy to Clipboard - JavaScript - dcode</h2>
<h2 id="title">Copy to Clipboard - JavaScript - dcode</h2>
<input id="myInp" type="text">
<input id="myInp" type="text">
<button id="btnCopy">Copy</button>
<button id="btnCopy">Copy</button>
</body>
</body>
<script type="text/javascript">
<script type="text/javascript">
複製
已複製
複製
已複製
const myInp = document.getElementById("
MyImp
");
const myInp = document.getElementById("
myInp
");
const btnCopy = document.getElementById("btnCopy");
const btnCopy = document.getElementById("btnCopy");
btnCopy.onclick = function () {
btnCopy.onclick = function () {
// Step 1 - Select the text
// Step 1 - Select the text
myInp.select();
myInp.select();
// Step 2 - Copying the text
// Step 2 - Copying the text
document.execCommand("Copy");
document.execCommand("Copy");
};
};
複製
已複製
複製
已複製
<
`
/script>
<
/script>
已保存差異
原始文本
開啟檔案
<body> <h2 id="title">Copy to Clipboard - JavaScript - dcode</h2> <input id="myInp" type="text"> <button id="btnCopy">Copy</button> </body> <script type="text/javascript"> const myInp = document.getElementById("MyImp"); const btnCopy = document.getElementById("btnCopy"); btnCopy.onclick = function () { // Step 1 - Select the text myInp.select(); // Step 2 - Copying the text document.execCommand("Copy"); }; <`/script>
更改後文本
開啟檔案
<body> <h2 id="title">Copy to Clipboard - JavaScript - dcode</h2> <input id="myInp" type="text"> <button id="btnCopy">Copy</button> </body> <script type="text/javascript"> const myInp = document.getElementById("myInp"); const btnCopy = document.getElementById("btnCopy"); btnCopy.onclick = function () { // Step 1 - Select the text myInp.select(); // Step 2 - Copying the text document.execCommand("Copy"); }; </script>
尋找差異