JS復(fù)制特定內(nèi)容到粘貼板
更新時(shí)間:2008年12月02日 23:14:38 作者:
比較簡單的復(fù)制內(nèi)容到粘貼板的測試代碼
<script language="javascript">
function readTxt()
{
alert(window.clipboardData.getData("text"));
}
function setTxt()
{
var t=document.getElementById("txt");
t.select();
window.clipboardData.setData('text',t.createTextRange().text);
}
</script>
<input name="txt" value="測試">
<input type="button" value="復(fù)制" onclick="setTxt()">
<input type="button" value="讀取" onclick="readTxt()">
function readTxt()
{
alert(window.clipboardData.getData("text"));
}
function setTxt()
{
var t=document.getElementById("txt");
t.select();
window.clipboardData.setData('text',t.createTextRange().text);
}
</script>
<input name="txt" value="測試">
<input type="button" value="復(fù)制" onclick="setTxt()">
<input type="button" value="讀取" onclick="readTxt()">
您可能感興趣的文章:
- js復(fù)制文本到粘貼板(Clipboard.writeText())
- H5 js點(diǎn)擊按鈕復(fù)制文本到粘貼板
- 基于js實(shí)現(xiàn)復(fù)制內(nèi)容到操作系統(tǒng)粘貼板過程解析
- 20行JS代碼實(shí)現(xiàn)粘貼板復(fù)制功能
- JS復(fù)制對應(yīng)id的內(nèi)容到粘貼板(Ctrl+C效果)
- JavaScript實(shí)現(xiàn)復(fù)制內(nèi)容到粘貼板代碼
- js實(shí)現(xiàn)點(diǎn)擊圖片將圖片地址復(fù)制到粘貼板的方法
- js 實(shí)現(xiàn)復(fù)制到粘貼板的功能代碼
- Web js實(shí)現(xiàn)復(fù)制文本到粘貼板
相關(guān)文章
asp ADO GetString函數(shù)與用GetString來提高ASP的速度
沒想到asp下有g(shù)etstring這個(gè)東西,看樣子不熟悉這塊啊,以后考慮用這個(gè),應(yīng)該不錯(cuò),另外還有g(shù)etrows等,都是asp下提高性能不錯(cuò)的函數(shù)。2007-12-12
asp 驗(yàn)證輸入網(wǎng)址是否有效并可以訪問 與正則驗(yàn)證輸入網(wǎng)址
這篇文章主要是驗(yàn)證用戶輸入的字符是否是網(wǎng)址的方法,需要的朋友可以參考一下2007-08-08
ASPWebPack(整站文件備份系統(tǒng)) v1.0.2 黑客也用
ASPWebPack(整站文件備份系統(tǒng)) v1.0.2 黑客也用...2007-10-10
ASP基礎(chǔ)入門第八篇(ASP內(nèi)建對象Application和Session)
這篇文章主要介紹了ASP內(nèi)建對象Application和Session的相關(guān)資料,需要的朋友可以參考下2015-10-10

