Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,我想在我的网站(html)上制作按钮。通过单击按钮,您可以更改站点的背景。我想在 *.js 文件中实现它。欢迎任何建议或想法如何做到这一点。
HTML
<input type="button" onclick="changeBackground()" value="Change Backgorund" />
JS
function changeBackground(){ $("body").css("background","url('pathtoimage')"); }