电脑故障

位置:IT落伍者 >> 电脑故障 >> 浏览文章

按钮完成复制和剪切功能


发布日期:2022/11/21
 

<SCRIPT language=JavaScript>

function copy(ob){var obj=findObj(ob); if (obj) {objselect();js=objcreateTextRange();jsexecCommand("Copy");}}function cut(ob){var obj=findObj(ob); if (obj) {objselect();js=objcreateTextRange();jsexecCommand("Cut");}}function findObj(n d) { //v var pix; if(!d) d=document; if((p=nindexOf("?"))>&&parentframeslength) { d=parentframes[nsubstring(p+)]document; n=nsubstring(p);} if(!(x=d[n])&&dall) x=dall[n]; for (i=;!x&&i<dformslength;i++) x=dforms[i][n]; for(i=;!x&&dlayers&&i<dlayerslength;i++) x=findObj(ndlayers[i]document); if(!x && documentgetElementById) x=documentgetElementById(n); return x;}//></SCRIPT><input type="button" name="Button" value="复制到剪贴板" onClick=copy(txtOutput)><input type="button" name="Button" value="剪贴到剪贴板" onClick=cut(txtOutput)> <br><form name="fom" method="post" action=""> <textarea name="txtOutput" rows="" cols=""> dfkghkldfghklsdjfhgklsdfhgklhsdfklghsdfklhj

上一篇:面向对象继承实例(a如何继承b问题)(自写)

下一篇:根据选择不同的下拉值出现相对应的文本输入框