<head> <script> $( document ).ready(function(){ $('#codeCopy').click(function(){ $('#RssCode').select() document.execCommand("copy"); alert("imgSrc Code를 복사하였습니다."); }); $('#onerrorCopy').click(function(){ $('#onerror').select() document.execCommand("copy"); alert("onerror를 복사하였습니다."); }); }); </script> </head> <body> <div class="card card-success"> <form> <div style="float:right; padding-right:20px;"> <input type="text" size="50" id="onerror" name="onerror" value=" onerror='this.style.display='none''"> <button type="button" class="btn btn-success" id="onerrorCopy">Copy</button> <input type="text" size="50" id="RssCode" name="RssCode" value="imgSrc = 'repia'"> <button type="button" class="btn btn-success" id="codeCopy">copy</button> </div> </form> </div> </body>