Move js script to external file

后端 未结 1 1383
攒了一身酷
攒了一身酷 2021-01-05 02:55

I have the following code in a div to move the div when clicking on he move button:

    

        
相关标签:
1条回答
  • 2021-01-05 03:22

    Steps for your solution are:

    1. Create a javascript file (a file with extension .js). Lets suppose the file is moveDiv.js
    2. Move all the javascript code into this newly created file as it is except <script> & </script> tags.
    3. Give reference to this file in your HTML file as

      <script src="moveDiv.js" type="text/javascript"></script>

    This should start moving your button again.

    0 讨论(0)
提交回复
热议问题