我需要一個函數,該函數可以更改傳遞的屬性的值。您可以在下面找到一個無法正常運行的示例。如何傳遞屬性并訪問參數?先感謝您!let top = {target: document.getElementById("header").style.top};animate(top, 50);function foo(attribute, value) { //some code attribute.target = value + "px";}
如何通過JavaScript傳遞引用?
UYOU
2021-05-13 14:08:56