LoginSignup
0
0

More than 3 years have passed since last update.

【javascript】javascriptの記述をhtmlファイルから呼び出す

Posted at

超初心者向けなお話です。

index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <h1>JavaScriptのお勉強</h1>
    <script src="main.js">

    </script>
</body>

</html>

<script src="main.js"></script>この記述を書くことによって、同じディレクトリ内のmain.jsファイルの記述を呼び出すことができます。

main.js
alert('がんばれ')

お勉強がんばりましょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0