<input type="button" name="anniu1" onclick="copyToClipBoard()" value="复制专题地址和url地址,传给QQ/MSN上的好友"> <br><br> <br><br> <br><br> <br><br><span></span>URL을 직접 복사<br><br> <input type="button" name="anniu2" onclick="copyUrl()" value="复制URL地址"><br> <br><br> <br><span></span><br>텍스트 상자 클릭 시 텍스트 상자 내용을 복사하세요. <br><input onclick="oCopy(this)" value="你好.要copy的内容!"> <br><br> <br><br> <br><br> <span></span> <br><br>텍스트 상자나 숨겨진 필드의 내용을 복사하세요<br><br> <input name="myimg" type="hidden" id="myimg" value="http://www.jb51.net"><br> <input name="imgurl" type="text" size="32" value="http://www.jb51.net"><br><input type="button" value="点击这里复制本站地址" onclick="CopyUrl(imgurl);"> <br> <br> <br><br> <br><br><br><br> <span></span> <br><br><br>span 태그 내용 복사<br> <br><br> <br> <br> <br><br> <br><br> <span id="tbid"></span>다음은 코드 스니펫입니다. <br> <a href="#" onclick="copyText(document.getElementById('tbid'))"></a> <br><span id="tbid2">http:/ /www.jb51.net </span> <br>[<a href="#" onclick="copyText(document.getElementById('tbid2'))">복사하려면 클릭</a>] <br><script language="javascript"> <BR>function copyToClipBoard(){ <BR>var clipBoardContent=""; <BR>clipBoardContent+=document.title; <BR>clipBoardContent+=""; <BR>clipBoardContent+=this.location.href; <BR>window.clipboardData.setData("Text",clipBoardContent); <BR>alert("复制成功,请粘贴到你的QQ/MSN上推荐给你的好友"); <BR>} <BR></script>http://www.jb51.net<script language="javascript"> <BR>function copyUrl() <BR>{ <BR>var clipBoardContent=this.location.href; <BR>window.clipboardData.setData("Text",clipBoardContent); <BR>alert("复制成功!"); <BR>} <BR></script> <script language="javascript"> <BR>function oCopy(obj){ <BR>obj.select(); <BR>js=obj.createTextRange(); <BR>js.execCommand("Copy") <BR>alert("复制成功!"); <BR>} <BR></script>[<script language="javascript"> <BR>function CopyUrl(target){ <BR>target.value=myimg.value; <BR>target.select(); <BR>js=myimg.createTextRange(); <BR>js.execCommand("Copy"); <BR>alert("复制成功!"); <BR>} <BR>function AddImg(target){ <BR>target.value="[IMG]"+myimg.value+"[/ img]"; <BR>target.select(); <BR>js=target.createTextRange(); <BR>js.execCommand("Copy"); <BR>alert("复制成功!"); <BR>} <BR></script>클릭 복사<script type="text/javascript"> <BR></script>] <script type="text/javascript">function copyText(obj) <BR>{ <BR>var rng = document.body.createTextRange(); <BR>rng.moveToElementText(obj); <BR>rng.scrollIntoView(); <BR>rng.select(); <BR>rng.execCommand("Copy"); <BR>rng.collapse(false); <BR>alert("复制成功!"); <BR>} <BR></script>