var str = $(".article_{$item[id]}").html(); var s_src = str.match(/<img.*?>/); $(".img_{$item[id]}").html(s_str);