function CopyClipboard()
{
var txt;
txt = document.body.createTextRange();
txt.moveToElementText(MainContents);
txt.execCommand("Copy");
alert("해당 상품 컨텐츠가 클립보드에 복사되었습니다.\n원하는 곳에 ctrl+v 로 붙여넣으시면 됩니다.(블로그 등)");
}
<div id="MainContents">여기에 복사된 내용이 들어간다</div>
{
var txt;
txt = document.body.createTextRange();
txt.moveToElementText(MainContents);
txt.execCommand("Copy");
alert("해당 상품 컨텐츠가 클립보드에 복사되었습니다.\n원하는 곳에 ctrl+v 로 붙여넣으시면 됩니다.(블로그 등)");
}
<div id="MainContents">여기에 복사된 내용이 들어간다</div>
반응형
'홈페이지 제작 > JavaScript' 카테고리의 다른 글
확대 이미지 레이어형식(DIV)으로 보여주기 (0) | 2007.03.13 |
---|---|
input, select 박스 disable 시키기 (0) | 2007.03.12 |
매월 마지막 날짜 확인하기 (0) | 2006.05.24 |
iframe 의 width, height 값을 크기에 맞게 자동 조절하기 (0) | 2006.04.13 |
TEXTAREA 에서 Focus() 위치 (커서위치) 마지막 으로 보내기 (0) | 2005.12.19 |