title: How can I use import and export with this simple code?
body: <p>I want to use the doAlert function in the index.js file. Now, how do I use import and export in this situation?</p>
  <pre><code>//index.html
  &lt;script type=&quot;module&quot; src=&quot;index.js&quot;&gt;&lt;/script&gt;
  
  //index.js
  /*'index.js' is an empty file.*/
  
  //doAlert.js
  function doAlert() {
      alert('Hello');
  }
  </code></pre>