请问:各位高手指点当:<span id="shop_consignee_{$sn}" class="shop_consignee"></span>我的JS写如下:document.getElementById("shop_consignee").innerHTML = '<span style="background:none repeat scroll 0 0 #FFF2BC;"><img src="themes/default/img/error.gif"> 请填写收货人姓名</span>';  
document.getElementById("shop_consignee").style.visibility='visible';  
 return false;  
这样写获得不到id,因为{$sn}是可变的,有可能是0,1,2等等,应该怎么样改正呢?