<body>
<div style=" float:left; width:100px; height:50px;">
<input type="button" id="changeStyle" " value="皮肤1" onClick="changeStyle()"/></div>
</body>
我需要在中加入一个像这样的函数,能帮帮忙吗
function changestyle(num){ document.style.backgroundImage="url("+num+".jpg)";
document.style.backgroundImage="url("+num+".jpg)";
}
<style>
黑色能变成b.jpg吗?
追答改成 background: url(img/xxxx.png);
本回答被提问者采纳