javascript赋值div
<div style="float:right;text-align:left;border:1px solid #0000ff;"id="left"></div>
<div style="width:300px;float:left;text-align:left;font-size:14px;line-height:24px; height:100px;border:1px solid #0000ff;" id="right"></div>
</div>
<script type="text/javascript">
function getId(obj) {
if(document.getElementById && document.getElementById(obj)){
return document.getElementById(obj);
}
if(document.all && document.all(obj)){
return document.all(obj);
}
if(document.layers && document.layers(obj)){
return document.layer(obj);
}
}
var left = getId("left");
var right = getId("right");
left.style.width = right.offsetWidth;
left.style.height = right.offsetHeight;
left.innerHTML = "none";
right.innerHTML = "ming";
</script>