📜  将 js 包含到 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:58.295000             🧑  作者: Mango

代码示例4


// hello.mjs -- or it could be simply `hello.js`
export function hello(text) {
  const div = document.createElement('div');
  div.textContent = `Hello ${text}`;
  document.body.appendChild(div);
}