--- tags: jQuery --- <style> .blue { color: blue; margin: 130px 0; display: block; } </style> <h1>複製圖片, 到另外的區域</h1> ### 程式碼 ```python=1 if ($('判斷某class 是否存在').length > 0) { var imgURL = $('被抓取區域的class').find('img').attr('src'); $('引用到某個區域 class ').css('background-image', 'url(' + imgURL + ')'); } ```