我尝试制作一个按钮来更改弹出窗口的背景颜色,这就是我所拥有的
let newWin = window.open("about:blank#Jacket_tabs", "hello", "width=712,height=534, fullscreen=yes, true");
此代码不运行
newWin.document.write("<button type='button' onclick='myFunction()'>Change Color</button><script>function myFunction(){ document.body.style.backgroundColor= 'black';}</script>")
这就是一切,但没有按钮
newWin.document.write("<body style='background-color:lack;'></body");
问题是你不能使用 " " 2 次它不起作用。我尝试使用 '' 但它没有用
这是代码