このウェブページをクリックすると、画像をクリックしてコピーできるテキストエリアにコードが表示されます。これまでのところとても良いですが、テキストエリアの現在のコードを置き換えて追加するのではなく、そのいずれかのピクチャをクリックするたびに可能になりました。目標は、あなた自身のレイアウトをまとめて、最後にコードをコピーすることです。複数の値をテキストエリアにロード
<body>
<a class="gridstyle grid-70-30" href="#"><img src="http://www.awesome-business.com/hero/70-30.jpg" alt="" /></a>
<a class="gridstyle grid-30-70" href="#"><img src="http://www.awesome-business.com/hero/30-70.jpg" alt="" /></a>
<a class="gridstyle grid-33-33-33" href="#"><img src="http://www.awesome-business.com/hero/33-33-33.jpg" alt="" /></a>
<a class="gridstyle grid-25-25-25-25" href="#"><img src="http://www.awesome-business.com/hero/25-25-25-25.jpg" alt="" /></a>
<a class="gridstyle kategorien" href="#"><img src="http://www.awesome-business.com/hero/kategorien.jpg" alt="" /></a>
<div class="clear"></div>
<div class="textausgabe"></div>
<button class="copy">Copy Textarea</button>
<textarea id="target"></textarea>
</body>
<script id="grid-70-30" type="text/template">
<div class='grid12-8'>Hier steht Inhalt</div><div class='grid12-4'>Hier steht Inhalt</div><div class='clearer'>
</script>
<script id="grid-30-70" type="text/template">
<div class='grid12-4'>Hier steht Inhalt</div><div class='grid12-8'>Hier steht Inhalt</div><div class='clearer'>
</script>
<script id="grid-33-33-33" type="text/template">
<div class='grid12-4'>Hier steht Inhalt</div><div class='grid12-4'>Hier steht Inhalt</div><div class='grid12-4'>Hier steht Inhalt</div><div class='clearer'>
</script>
<script id="grid-25-25-25-25" type="text/template">
<div class='grid12-3'>Hier steht Inhalt</div><div class='grid12-3'>Hier steht Inhalt</div><div class='grid12-3'>Hier steht Inhalt</div><div class='grid12-3'>Hier steht Inhalt</div><div class='clearer'></div>
</script>
<script id="kategorien" type="text/template">
<div></div>
</script>
<script type="text/javascript">
jQuery("button.copy").click(function() {
jQuery("textarea#target")[0].select();
var successful = document.execCommand('copy');
if(successful) {
alert('Copied');
}
});
jQuery(".grid-70-30").click(function() {
jQuery("textarea#target").val(jQuery.trim(jQuery("#grid-70-30").html()));
});
jQuery(".grid-30-70").click(function() {
jQuery("textarea#target").val(jQuery.trim(jQuery("#grid-30-70").html()));
});
jQuery(".grid-33-33-33").click(function() {
jQuery("textarea#target").val(jQuery.trim(jQuery("#grid-33-33-33").html()));
});
jQuery(".grid-25-25-25-25").click(function() {
jQuery("textarea#target").val(jQuery.trim(jQuery("#grid-25-25-25-25").html()));
});
jQuery(".kategorien").click(function() {
jQuery("textarea#target").val(jQuery.trim(jQuery("#kategorien").html()));
});
</script>
あなたたちはそれを行うためにどのように任意のアイデアを持っていますか?私はそうしない!
意味のあるコードとここで問題の記述を追加してください。修復が必要なサイト にリンクしないでください。そうしないと、 問題が解決されたり、リンク先のサイトにアクセスできない場合、この質問は将来の訪問者に価値を失います。 [最小、完全、および検証可能な例(MCVE)](https://stackoverflow.com/help/mcve)を投稿すると、 があなたの問題を実証してくれます。詳細については、 [私のWebサイトの何かが動作しません。 ]リンクを貼り付けることはできますか?](https://meta.stackexchange.com/questions/125997/) ありがとう! – j08691
完了!ありがとうございます – Kazu