请教个复制问题,高人给看看能实现吗
<script type="text/javascript">function copyText(obj)
{
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
alert("复制成功!");
}
</script>
<span id="url"><a href='http://www.****.com' target='_blank'>222222</a></span>
<a href="###" onclick="copyText(document.all.url)">点击复制</a>
如何实现把这段全复制 <a href='http://www.****.com' target='_blank'>222222</a>