首页 > 解决方案 > Give function parameter before itself

问题描述

Is it possible calling element in function if I write that element before the function, example:

let demo = document.getElementById("demo")
demo.giveMeElement()

function demo() {
  // How can I get that #demo element here
}
<div id="demo"></div>

标签: javascriptfunction

解决方案


推荐阅读