Import javascript in HTML

6 Sep 2015,
Share: 

วิธีการ Import javascript (*.js)  ลงใน Code HTML สามารถทําได้ ดังนี้

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

or

<script src="myFile.js"></script>

โดยปกติแล้วจะแทรกไว้ใน Tag

Example

<!DOCTYPE html>
<html>
<head>
    <title>Test import javascript file</title>
    <script src="myFile.js"> </script>

</head>
<body>

</body>
</html>

Copyright © 2019 - 2025 thiti.dev |  v1.51.0 |  Privacy policy | 

Build with ❤️ and Astro.

Github profile   Linkedin profile   Instagram   X profile   Nostr   Youtube channel   Telegram   Email contact   วงแหวนเว็บ