我想在内联样式声明中使用javascript变量screen作为样式背景属性。
<div id ="content" style=" position: relative; top: -400px; left: 0px; width: 60px; height: 400px; z-index: 901;background-image: url(' + screen + ') "></div>
document.write('<div id ="content"
style="
position: relative;
top: -400px;
left: 0px;
width: 60px;
height: 400px;
z-index: 901;
background-image: url(' + screen + ')
">
</div>')
或
document.getElementById('content').style.backgroundImage = screen;