日期:2014-05-17 浏览次数:20739 次
<input id="bt_a" type="button" value="选中产品内容" onclick= "rdl_createRange1()"/>
<div id="com_a">
<div id="com_b" class="boxCenterList RelaArticle"></div>
<div id="com_c">
<blockquote>
{$goods.goods_desc} //产品内容包含文字和图片
</blockquote>
</div>
</div>
<script>
function rdl_createRange1(){
//这个地方只能选取id为com_b的层,ecshop商城的产品页面
var oMessage=document.all("com_b");
var oTextRange=document.body.createTextRange();
with (oTextRange) {
moveToElementText(oMessage);
execCommand("SelectAll");
}
var oTextRange=document.selection.createRange();
}
</script>