... | ... | @@ -9,6 +9,7 @@ index.html |
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<title>JS Frontend CI Tutorial</title>
|
|
|
<script src="js/sum.js"></script>
|
|
|
<script src="js/main.js"></script>
|
|
|
</head>
|
|
|
<body>
|
... | ... | @@ -27,12 +28,15 @@ index.html |
|
|
</html>
|
|
|
```
|
|
|
|
|
|
js/main.js
|
|
|
js/sum.js
|
|
|
```
|
|
|
const sum = (a, b) => {
|
|
|
return a + b;
|
|
|
};
|
|
|
```
|
|
|
|
|
|
js/main.js
|
|
|
```
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
const btn = document.querySelector('#sum_button');
|
|
|
const input1 = document.querySelector('#input_number_1');
|
... | ... | |